Skip to content

[tvOS] Crash on reload when using updateTheme #938

@slvvn

Description

@slvvn

What happened?

In my attempt to make a repro of #919, I found that the same crash happens sometimes when I reload the bundle (r), when having UnistylesRuntime.updateTheme() in a useEffect (which depends on some fetched external data). Not sure if this is entirely related, but the same stack trace appears.
It only seems to be happening with the react-native-tvos fork (while running it on iOS though). I know it's not officially supported, but an investigation would be much appreciated!

Steps to Reproduce

  1. Run the repro on iOS simulator
  2. Open the app
  3. Reload the app a few times (with some time in between)
  4. App crashes

Snack or Repository Link (Optional)

https://github.com/slvvn/unistyles-v3-repro/tree/repro/crash-on-hmr

Unistyles Version

3.0.7

React Native Version

0.79.5-0 (tvos)

Platforms

iOS

Expo

Yes

Additional information

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions