Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat[ReactFabricPrivateInterface]: add getInternalInstanceHandleFromPublicInstance #41786

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -79,3 +84,9 @@ export function getNodeFromPublicInstance(
publicInstance.__internalInstanceHandle,
);
}

export function getInternalInstanceHandleFromPublicInstance(
publicInstance: ReactFabricHostComponent | ReactNativeElement,
): InternalInstanceHandle {
return publicInstance.__internalInstanceHandle;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import typeof CustomEvent from '../Events/CustomEvent';
import typeof {
createPublicInstance,
createPublicTextInstance,
getInternalInstanceHandleFromPublicInstance,
getNativeTagFromPublicInstance,
getNodeFromPublicInstance,
} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
Expand Down Expand Up @@ -108,4 +109,8 @@ module.exports = {
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
.getNodeFromPublicInstance;
},
get getInternalInstanceHandleFromPublicInstance(): getInternalInstanceHandleFromPublicInstance {
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
.getInternalInstanceHandleFromPublicInstance;
},
};