I have a component in react that renders a .glb model using useGLTF, let's call it 3DComponent
But the component reloads the model every time a link is performed to it
Is there a way for 3DComponent to use the same model loaded in the previous render?
The way this component is declared is:
export default function Model({ ...props }) {
==> const { nodes, materials, animations } = useGLTF('/studio.glb');
const group = useRef();
const { actions } = useAnimations(animations, group);
...
...
Every time it renders it performs useGLTB, but I can´t condition useGLTB since it's a hook and can't be conditioned without a compile error
What could I do to avoid reloading the model for every other render?
Thanks in advance
Rafael