SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

tear down surfaces when React Native instance is destoyed (#44209)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44209

## Changelog:

[Android] [Fixed] - When React Native is destroyed, unmount all Fabric surfaces.

Previously, Fabric surfaces would not be torn down. Meaning that passive and layout effects wouldn't be unmounted and surface infra wouldn't be cleaned up.

For example:

```
useEffect(() => {
    return () => {
      console.log('unmounted');
    }
)};
```

When calling `ReactNativeHost.clear()` on Android in native code, the above effect should be unmounted.

This is a requirement for Fabric.

Reviewed By: javache

Differential Revision: D56238947

fbshipit-source-id: 5dbf5cdef520f34c78953c2b8f2d42349549e893
S
Samuel Susla committed
4928f44f70943f90c9105fccc5f14731073d4666
Parent: c884d19
Committed by Facebook GitHub Bot <[email protected]> on 4/23/2024, 5:18:55 PM