Skip to content

Conversation

@ryantrem
Copy link
Member

This is a fix for issue #78. The problem is that for some reason on Android specifically in release builds we get an extra app state changed event from React Native and incorrectly start a second render loop. The fix is to store the app state in react state, update it in the app state changed event, and start/stop the render loop as a side effect of an actual change in app state.

I also updated Babylon.js to the latest, which for some reason removed the dependency from loaders to core, which also fixes the issue where we end up with two definitions of RegisterPlugin and break gltf loading. It doesn't look like anything in Babylon.js changed, so the only thing I can think is that this is an issue with NPM itself, maybe if you install the dependencies out of order or something...

I also noticed that the engine returned by useEngine was not getting cleared when the associated useEffect cleans up (e.g. on unmount and fast refresh). I'm not aware of any problems this was causing, but it was not correct, so I fixed it in this PR as well.

@ryantrem ryantrem merged commit b0b928f into BabylonJS:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants