Texture loader routing

Hi guys I have a question,

I use react-router-dom (with useNavigate) for routing in my application for routing from “/home” “/login” “/magazines”… basic routing thing. BUT when I change route and my page looks like: http://localhost:3000/magazine/26 all

new three.TextureLoader().load(“some_simple_image.jpg”)

is translated to:

new three.TextureLoader().load("/magazine/some_simple_image.jpg")

and I have to manualy write:

new three.TextureLoader().load(". ./some_simple_image.jpg")

Is there some way to prevent this route concating (fetch don’t have this behaviour) ???

try “/some_simple_image.jpg” or import the images. by importing them they’re part of the bundle and reside inside /src, not /public.
as for routes in general, mixing three and react is a bit awkward because these are two different worlds. drive three through react and can can define routes inside your canvas, have mount transitions for meshes etc. Router transitions - CodeSandbox (the example uses wouter instead of react-router, but should be the same)

“/xyz” really helped, thanks. And thanks for link on sandbox, I will use it in my other projects have I nice day.