mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 08:30:34 +00:00
Fix nodeHandle crash
Summary: It's supposed to take a component or a handle, per the arg name, so switch on the type (and handle `null`). `FlatListExample` no longer crashes. Reviewed By: bvaughn, sebmarkbage Differential Revision: D4752619 fbshipit-source-id: 720421f648f7c2049b5cc44f006484eb47d22d86
This commit is contained in:
parent
46d6766a53
commit
93c438d470
@ -37,7 +37,11 @@ var ReactNative = {
|
||||
// The injected findNodeHandle() strategy returns the instance wrapper though.
|
||||
// See NativeMethodsMixin#setNativeProps for more info on why this is done.
|
||||
findNodeHandle(componentOrHandle : any) : ?number {
|
||||
return findNodeHandle(componentOrHandle).getHostNode();
|
||||
const nodeHandle = findNodeHandle(componentOrHandle);
|
||||
if (nodeHandle == null || typeof nodeHandle === 'number') {
|
||||
return nodeHandle;
|
||||
}
|
||||
return nodeHandle.getHostNode();
|
||||
},
|
||||
|
||||
render: render,
|
||||
|
Loading…
x
Reference in New Issue
Block a user