Hi guys,
thanks for the very well done quick-start package!
I'm not a frontend dev, so forgive me if I'm asking for something really basic.
As far as I understand webpack, you have to add dependencies (like react-router) in webpack.config.js.
Can I do this without ejecting?
Not quite, to add react-router you have to:
npm install --save react-routerFor example, you could do something like this:
import { Router, Router, browserHistory } from 'react-router';
/* … */
class App extends Component {
render() {
return (
<Router history={browserHistory}>
<Route path="/" component={Something} />
</Router>
);
}
}
No need to change the webpack config!
@mxstbr I recommend you update your answer to use the browserHistory:
<Router history={browserHistory}>
...
@mxstbr Why did you duplicate Router twice in import {Router, Router,...
@samayo One of them should have been Route
Most helpful comment
Not quite, to add react-router you have to:
npm install --save react-routerFor example, you could do something like this:
No need to change the webpack config!