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 pages.
However it works for just one level e.g /dashboard but the css won't load for /components/timer
Here is what my index.jsx file looks like
import './assets/plugins/morris/morris.css';
import './assets/css/bootstrap.min.css';
import './assets/css/core.css';
import './assets/css/components.css';
import './assets/css/icons.css';
import './assets/css/pages.css';
import './assets/css/menu.css';
import './assets/css/responsive.css';
render(
<Router history={browserHistory}>
<Route path="/" component={Dashboard}/>
<Route path="/components/:name" component={WidgetComponent}/>
<Route path="*" component={Dashboard}/>
</Router>,
document.getElementById('root')
);
Any idea why?
/and/components/:nameto your index.js where you load react and all related files?http://localhost:3000/components/assets/js/jquery.slimscroll.jsinstead ofhttp://localhost:3000/assets/js/jquery.slimscroll.js/components/:name?