File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
packages/react-native/Libraries
ReactNative/ReactFabricPublicInstance Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 88 * @flow strict-local
99 */
1010
11+ /**
12+ * This module is meant to be used by the React renderers to create public
13+ * instances and get some data from them (like their instance handle / fiber).
14+ */
15+
1116import type ReactNativeElement from '../../DOM/Nodes/ReactNativeElement' ;
1217import type ReadOnlyText from '../../DOM/Nodes/ReadOnlyText' ;
1318import typeof ReactFabricType from '../../Renderer/shims/ReactFabric' ;
@@ -79,3 +84,9 @@ export function getNodeFromPublicInstance(
7984 publicInstance . __internalInstanceHandle ,
8085 ) ;
8186}
87+
88+ export function getInternalInstanceHandleFromPublicInstance (
89+ publicInstance : ReactFabricHostComponent | ReactNativeElement ,
90+ ) : InternalInstanceHandle {
91+ return publicInstance . __internalInstanceHandle;
92+ }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import typeof CustomEvent from '../Events/CustomEvent';
1919import typeof {
2020 createPublicInstance ,
2121 createPublicTextInstance ,
22+ getInternalInstanceHandleFromPublicInstance ,
2223 getNativeTagFromPublicInstance ,
2324 getNodeFromPublicInstance ,
2425} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance' ;
@@ -108,4 +109,8 @@ module.exports = {
108109 return require ( '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance' )
109110 . getNodeFromPublicInstance ;
110111 } ,
112+ get getInternalInstanceHandleFromPublicInstance ( ) : getInternalInstanceHandleFromPublicInstance {
113+ return require ( '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance' )
114+ . getInternalInstanceHandleFromPublicInstance ;
115+ } ,
111116} ;
You can’t perform that action at this time.
0 commit comments