summaryrefslogtreecommitdiff
path: root/src/main/js/src/index.js
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2016-12-18 18:02:12 +0100
committerVictor Chabbert <chabbertvi@eisti.eu>2016-12-18 18:02:12 +0100
commit2cc74d254004d2551c19c778ce7f7d2070a9b45b (patch)
treece9ab49cfd9ada3af8e83533c0b82059730cdd14 /src/main/js/src/index.js
parentClean front-end files (diff)
downloadseven-wonders-2cc74d254004d2551c19c778ce7f7d2070a9b45b.tar.gz
seven-wonders-2cc74d254004d2551c19c778ce7f7d2070a9b45b.tar.bz2
seven-wonders-2cc74d254004d2551c19c778ce7f7d2070a9b45b.zip
Add react-router with small example
Diffstat (limited to 'src/main/js/src/index.js')
-rw-r--r--src/main/js/src/index.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/js/src/index.js b/src/main/js/src/index.js
index 93feb5d3..31ddded9 100644
--- a/src/main/js/src/index.js
+++ b/src/main/js/src/index.js
@@ -1,8 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
+import { BrowserRouter, Match, Miss } from 'react-router'
import { Provider } from 'react-redux'
import configureStore from './store'
-import './index.css'
const initialState = {}
const store = configureStore(initialState)
@@ -11,11 +11,21 @@ if (window.devToolsExtension) {
window.devToolsExtension.updateStore(store)
}
+import './index.css'
import App from './containers/App'
+const NoMatch = () => {
+ return <h1>No Match</h1>
+}
+
ReactDOM.render(
<Provider store={store}>
- <App />
+ <BrowserRouter>
+ <div className="app">
+ <Match exactly pattern="/" component={App} />
+ <Miss component={NoMatch} />
+ </div>
+ </BrowserRouter>
</Provider>,
document.getElementById('root')
);
bgstack15