git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: d257f1cb78aa333ab6399429df9d754ce4f561f5

Files: d257f1cb78aa333ab6399429df9d754ce4f561f5 / app / client.js

958 bytesRaw
1const React = require('react')
2const { render } = require('react-dom')
3const { Provider } = require('react-redux')
4const { Router } = require('react-router')
5const { createHistory } = require('history')
6const { syncReduxAndRouter } = require('redux-simple-router')
7
8const routes = require('app/routes')
9const createStore = require('app/store')
10const fetchElement = require('app/util/fetch-element')
11
12if (process.env.NODE_ENV === 'development') {
13 var DevTools = require('app/components/dev-tools')
14}
15
16const store = createStore(window.__data)
17const history = createHistory()
18
19syncReduxAndRouter(history, store)
20
21const component = (
22 <Router createElement={fetchElement} history={history}>
23 { routes }
24 </Router>
25)
26
27render(
28 <Provider store={store} key="provider">
29 <div>
30 { component }
31 {
32 (process.env.NODE_ENV === 'development') ?
33 <DevTools /> : null
34 }
35 </div>
36 </Provider>,
37 document.querySelector('main')
38)
39

Built with git-ssb-web