dillon1000/react

Commit

Guard against unmounted components when accessing public instances on Fabric (#27687)

## Summary

This fixes an error in `getPublicInstanceFromInstanceHandle` where we
throw an error when trying to access the public instance from the fiber
of an unmounted component. This shouldn't throw but return `null`
instead.

## How did you test this change?

Updated unit tests.
Before: 
<img width="969" alt="Screenshot 2023-11-10 at 15 26 14"
src="https://github.com/facebook/react/assets/117921/ea161616-2775-4fab-8d74-da4bef48d09a">

After: 
<img width="1148" alt="Screenshot 2023-11-10 at 15 28 37"
src="https://github.com/facebook/react/assets/117921/db18b918-b6b6-4925-9cfc-3b4b2f3ab92d">
Browse files
Changed paths3 files
First-parent comparison
M packages/react-native-renderer/src/ReactFiberConfigFabric.js ModifiedM packages/react-native-renderer/src/ReactNativeTypes.js ModifiedM packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…