software-mansion / react-native-screens

Native navigation primitives for your React Native app.
https://docs.swmansion.com/react-native-screens/
MIT License
3.1k stars 521 forks source link

fix: Remove dangling global reference to `ScreenModule` #2494

Closed lukmccall closed 1 week ago

lukmccall commented 1 week ago

Description

Removes a dangling global reference to the ScreenModule.

Changes

When the application reloads, nativeInstall is called, which overwrites the reference to globalThis without deleting it. This PR deletes the reference before creating a new one.

Test code and steps to reproduce

I've tested it in a new project created using expo (SDK 52) and with fabric turn on.