I\'m trying to setup a react-router
for my first React webapp, it seems to be working except that the css doesn\'t load for my nested pages when I refresh the p
The simplest solution is here (Need to change index.html only)
Just use %PUBLIC_URL%
before every CSS or JS file.
You can check an example of %PUBLIC_URL%
in index.html
file if you created react app through create-react-app
.
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
One thing is must: your CSS files and js files should be under a public directory.