Skip to content

Commit

Permalink
Types: findHostInstance_DEPRECATED returns React.ElementRef<HostCompo…
Browse files Browse the repository at this point in the history
…nent<mixed>> (#17265)

* Types: findHostInstance_DEPRECATED returns React.ElementRef<HostComponent<mixed>>

* Prettier
  • Loading branch information
elicwhite authored Nov 4, 2019
1 parent 62ef250 commit 6095993
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;

function findHostInstance_DEPRECATED(
componentOrHandle: any,
): ?HostComponent<mixed> {
): ?React$ElementRef<HostComponent<mixed>> {
if (__DEV__) {
const owner = ReactCurrentOwner.current;
if (owner !== null && owner.stateNode !== null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactNativeRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;

function findHostInstance_DEPRECATED(
componentOrHandle: any,
): ?HostComponent<mixed> {
): ?React$ElementRef<HostComponent<mixed>> {
if (__DEV__) {
const owner = ReactCurrentOwner.current;
if (owner !== null && owner.stateNode !== null) {
Expand Down
4 changes: 3 additions & 1 deletion packages/react-native-renderer/src/ReactNativeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ type SecretInternalsFabricType = {
*/
export type ReactNativeType = {
NativeComponent: typeof ReactNativeComponent,
findHostInstance_DEPRECATED(componentOrHandle: any): ?HostComponent<mixed>,
findHostInstance_DEPRECATED(
componentOrHandle: any,
): ?ElementRef<HostComponent<mixed>>,
findNodeHandle(componentOrHandle: any): ?number,
dispatchCommand(handle: any, command: string, args: Array<any>): void,
render(
Expand Down

0 comments on commit 6095993

Please sign in to comment.