dillon1000/react
Commit
Browse files Clean interface for public instances between React and React Native (#26416)
## Summary We are going to move the definition of public instances from React to React Native to have them together with the native methods in Fabric that they invoke. This will allow us to have a better type safety between them and iterate faster on the implementation of this proposal: https://github.com/react-native-community/discussions-and-proposals/pull/607 The interface between React and React Native would look like this after this change and a following PR (#26418): React → React Native: ```javascript ReactNativePrivateInterface.createPublicInstance // to provide via refs ReactNativePrivateInterface.getNodeFromPublicInstance // for DevTools, commands, etc. ReactNativePrivateInterface.getNativeTagFromPublicInstance // to implement `findNodeHandle` ``` React Native → React (ReactFabric): ```javascript ReactFabric.getNodeFromInternalInstanceHandle // to get most recent node to call into native ReactFabric.getPublicInstanceFromInternalInstanceHandle // to get public instances from results from native ``` ## How did you test this change? Flow Existing unit tests
Changed paths7 files
First-parent comparisonpackages/react-native-renderer/src/ReactFabric.js ModifiedM packages/react-native-renderer/src/ReactFabricHostConfig.js ModifiedM packages/react-native-renderer/src/ReactFabricPublicInstanceUtils.js ModifiedM packages/react-native-renderer/src/ReactNativeFiberInspector.js ModifiedM packages/react-native-renderer/src/ReactNativePublicCompat.js ModifiedM packages/react-native-renderer/src/ReactNativeTypes.js ModifiedM packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…