mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
feat[ReactFabricPrivateInterface]: add getInternalInstanceHandleFromPublicInstance (#41786)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41786 Changelog: [Internal] This is the preprequisite for https://github.com/facebook/react/pull/27783 Reviewed By: rubennorte Differential Revision: D51808831 fbshipit-source-id: c8ddf67d7ad35a670fa462c246dcb7230ba47716
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e9b80971c7
commit
cd395b552b
Vendored
+11
@@ -8,6 +8,11 @@
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
/**
|
||||
* This module is meant to be used by the React renderers to create public
|
||||
* instances and get some data from them (like their instance handle / fiber).
|
||||
*/
|
||||
|
||||
import type ReactNativeElement from '../../DOM/Nodes/ReactNativeElement';
|
||||
import type ReadOnlyText from '../../DOM/Nodes/ReadOnlyText';
|
||||
import typeof ReactFabricType from '../../Renderer/shims/ReactFabric';
|
||||
@@ -79,3 +84,9 @@ export function getNodeFromPublicInstance(
|
||||
publicInstance.__internalInstanceHandle,
|
||||
);
|
||||
}
|
||||
|
||||
export function getInternalInstanceHandleFromPublicInstance(
|
||||
publicInstance: ReactFabricHostComponent | ReactNativeElement,
|
||||
): InternalInstanceHandle {
|
||||
return publicInstance.__internalInstanceHandle;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import typeof CustomEvent from '../Events/CustomEvent';
|
||||
import typeof {
|
||||
createPublicInstance,
|
||||
createPublicTextInstance,
|
||||
getInternalInstanceHandleFromPublicInstance,
|
||||
getNativeTagFromPublicInstance,
|
||||
getNodeFromPublicInstance,
|
||||
} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
|
||||
@@ -108,4 +109,8 @@ module.exports = {
|
||||
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
|
||||
.getNodeFromPublicInstance;
|
||||
},
|
||||
get getInternalInstanceHandleFromPublicInstance(): getInternalInstanceHandleFromPublicInstance {
|
||||
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
|
||||
.getInternalInstanceHandleFromPublicInstance;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user