Closed RichardBrowning closed 2 years ago
You'll need to import your model as a module and let your bundler transform it:
import modelPath from './path/to/model.glb'
useGLTF(modelPath)
The solution works flawlessly. Thank you very much!
Sorry, I'm not sure if this solution still works anymore.
"react-native": "0.71.8", "@react-three/drei": "^9.77.0", "@react-three/fiber": "^8.13.3",
gltfjsx: 6.2.9
Hello,
I am having a problem using .js file generated with GLTFJSX in react native / expo. I used the same process to generate JS file as I did with react.js.
npx gltfjsx model.gltf
However, it does not work and returns this message below to me:This is the JS file generated. I made some modifications but it is mostly original:
The .glb file is under the /public folder, in the Root.
I believe this is a problem that useGLTF cannot find the file. If so, how may I make changes to the path, please?
Thank you in advance.