While building a ReactJS project, I have linked some css files directly in index.html file instead of importing them in js/jsx file. It works fine if the route is plain like ("/app") but it do not load that css files against the routes containing params ("/app/:id"). Why and what is the solution.
P Ξ D R O L U Z 🐿
Learn a few things on the way and I'm still learning. I like to take long walks to the fridge. Software Engineer from 🇵🇹 lives in 🇬🇧
Without looking at code is kind hard. But I would probably say that the css links are using relative path. so if you are in a route /foo/bar, is trying to load /foo/bar/style.css and if you change to route /pim/pam/pum will try to load /pim/pam/pum/style.css.
But this is just wild guess. Try to had a initial / to <link _rel_="stylesheet" _href_="/styles.css">