Skip to content

Commit

Permalink
ReactNativeFiber.findNodeHandle() also handles numeric type
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Mar 23, 2017
1 parent 8d56e6d commit 4775047
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/renderers/native/ReactNativeFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,13 @@ const ReactNative = {
// External users of findNodeHandle() expect the host tag number return type.
// The injected findNodeHandle() strategy returns the instance wrapper though.
// See NativeMethodsMixin#setNativeProps for more info on why this is done.
findNodeHandle(componentOrHandle: any): ?number {
findNodeHandle(componentOrHandle : any) : ?number {
const instance: any = findNodeHandle(componentOrHandle);
return instance ? instance._nativeTag : null;
if (instance == null || typeof instance === 'number') {
return instance;
} else {
return instance._nativeTag;
}
},

render(element: Element<any>, containerTag: any, callback: ?Function) {
Expand Down

0 comments on commit 4775047

Please sign in to comment.