Files
react/packages/react-native-renderer/src/findNumericNodeHandle.js
T
Dan Abramov 45c1ff348e Remove unnecessary 'use strict' in the source (#11433)
* Remove use strict from ES modules

* Delete unused file

This was unused since Stack.
2017-11-02 20:32:48 +00:00

26 lines
750 B
JavaScript

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import findNodeHandle from './findNodeHandle';
/**
* 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.
*/
export default function findNumericNodeHandleFiber(
componentOrHandle: any,
): ?number {
const instance: any = findNodeHandle(componentOrHandle);
if (instance == null || typeof instance === 'number') {
return instance;
}
return instance._nativeTag;
}