import React, { Suspense } from 'react'
import { useGLTF } from '@react-three/drei'
const MagicRoom = () => {
// Importing model
const Model = () => {
const gltf = useGLTF('./libs/the_magic_room/scene.gltf', true)
return <primitive object={gltf.scene} dispose={null} scale={1} />
}
return (
<Suspense fallback={null}>
<Model />
</Suspense>
)
}
export default MagicRoom
I'm trying to use primitive to import gltf model in react-fibre, but it gives the above error
primitiveplaceholder can be found in @react-three/fiber, importing this module will resolve the error. So the final code looks like: