Raw package with React

I don’t want to use the Babylon React just because I believe its much hard to read the code that way, that’s basically the reason.

I’m a React developer so I want to use the UI as much as I can with that framework, but I want React only for UI and I don’t want to use the React way of writing the babylon code itself (for mashes, physics and so on). Is there a recommended usability of how to do this? Or this isn’t recommended at all?

When you say “not using the React way”, do you mean using declarative components? If so, it’s perfectly fine to not use them in a React project, Babylon is pretty flexible in the way you use it! I’ll link the non-declarative example from the react-babylonjs project: react-babylonjs/nonDeclarative.stories.js at master · brianzinn/react-babylonjs · GitHub. Inside the onSceneMount function you can program in the same way as vanilla JS.

Oh I’m sorry, I did not knew how to call them, but yes, I was talking about the declarative components. I clearly couldn’t find the solution since I was making the wrong search :sweat_smile:

Thank you @carolhmj, you helped me a lot!

1 Like