Replies: 1 comment 2 replies
-
this is a javascript error. something is wrong with the code you're trying to import.
i do not understand, TextureLoader comes from threejs. useLoader does nothing, it's just const [a, b, c] = useTexture(["a.jpg", "b.jpg", "c.jpg"])
return (
<>
<mesh>
<meshBasicMaterial map={a} />
...
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, as per the texture documentation Im trying to make use of TextureLoader and useLoader to load multiple textures into a mesh. I have a carousel of three planes and need to pass 3 different textures into the mesh's map so each carousel item displays a different texture(pictures in my case).
React keeps complaining that I have a "SyntaxError: Cannot use import statement outside a module".
I believe this is due to my TextureLoader import. Has anyone ran into this issue before?
I ended up trying to resort to only using threeJS's regular loader, but I'm now unable to pass multiple textures like the document illustrates using the useLoader and TextureLoader combination.
Beta Was this translation helpful? Give feedback.
All reactions