My project is rendering two times from the start. Models are rendered two times, Scene is getting rendered multiple times. The whole code is in the playground. Please excuse for the console logs and comments.
Anyone have any idea how to avoid this ?
React + TS + Babylonjs
If that doesn’t help… Maybe you can try to reproduce the problem with a minimal example?
Will take a look at that
Anyway I tried to recreate the app by importing a single model
Same issue is being recreated
Sharing code in the playground is not helping if it is not running
No idea what the issue is, but you will need to reproduce this somehow otherwise we won’t be able to help.
It’s probably because you are in Strict mode - won’t happen in production. You can remove strict, but it does help you out picking up some errors.
edit: Strict Mode – React (reactjs.org)
Because the above methods might be called more than once, it’s important that they do not contain side-effects.
Reacts strict mode is the culprit/target here. In production it is going fine.