mirror of
https://github.com/facebook/react.git
synced 2026-02-26 02:44:59 +00:00
This doesn't actually need to share any state because it goes through the instance to the fiber structure. Since Fabric is on the same version as RN, calling it on either renderer works.
29 lines
824 B
JavaScript
29 lines
824 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;
|
|
}
|
|
if (instance.canonical) {
|
|
return instance.canonical._nativeTag;
|
|
}
|
|
return instance._nativeTag;
|
|
}
|