i just updated my dependencies in an older project form react-three-fiber and drei to @react-three/fiber and drei. Everything works as expected and the overall performance is way better. Unfortunately the change of my object in primitive is not working properly.
Here is my ModelComponent:
function Model(props) {
const model = useLoader(GLTFLoader, props.src);
return (
<mesh position={props.position} rotation={props.rotation}>
<primitive
object={model.scene}
/>
</mesh>
);
}
I switch props.src between two sources, but then both models are loaded at the same time, and when I switch back the second one won't show at all anymore.
Before updateing my dependencies everything worked fine. I think it has to be some caching issue, but I can't figure out what exactly is the problem.
I hope you can help me.
thanks in regard.