Context Bridge
These can be used to bring context across renderer boundaries.
In react-babylonjs
that will typically be from the react-dom
renderer
context crossing over Engine to Scene components. So, capture (Consumer) the
context outside and "Provide" inside the Scene.
Example is given here - you would need these for Themes or libraries like Redux that depend on context. If you are using Redux and your project is not too far along consider switching to a state management library that doesn't suffer from this issue such as Zustand.
- Output
- Code