react-router-webpack-history-example
react-router-webpack-history-example copied to clipboard
Example app using react-router and webpack-dev-server with html5 history API
react-router and webpack-dev-server with history example app
This is an example app using react-router and webpack, along with the handy webpack-dev-server.
The dev server is configured with historyApiFallback: true
in webpack.config.js
,
which allows use of createBrowserHistory
in react-router for better looking URLs
(using the HTML5 pushState/history API).
webpack-dev-server will serve index.html
instead of any 404 request, which allows
react-router to pick up the URL and build the correct application state.
run locally
$ npm install
$ npm start # or `webpack-dev-server`