Hello everyone,
I am trying to make 3d react components with react-three-fiber, however, I am not sure if they will be reusable or not? It takes me a long time to animate in 3d and I have medium experience with react but a good amount with three.js. Do you think it is possible to make a react component for different premade 3d models which I can then exploit based on the need of the 3d component (display information, a button, text input, …).
Any help would be appreciated!
It depends entirely on how you package them, but in general they should be re-usable provided the appropriate import statements resolve, node modules are installed, etc. Can you share an example of a component that you would like to make reusable?
For example I am trying to make a login component which can be any 3d element (rectangular prism, sphere, pyramid …) yet can also be the required text input and has authenticates when triggered by a button or such. Could I then use the same 3d component, with different things nested underneath to display images or text which I retrieve from my backend? (made with Django REST framework)
Yes, you totally can. That’s one of the nicer things about React’s component model. If you have external assets like images or videos, you’ll need to ensure they can be accessed from whatever location your component will be re-used from.
It is also possible to have assets be bundled in the same location as the rest of your component, so that is an option if you really need it: