git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: 3582ba8ad59f6e36f60142e530d0794c1e02c095

Files: 3582ba8ad59f6e36f60142e530d0794c1e02c095 / app / client.js

1053 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}
14
15const store = createStore(window.__data)
16const history = createHistory()
17
18syncReduxAndRouter(history, store)
19
20const main = (
21 <Router createElement={fetchElement} history={history}>
22 { routes }
23 </Router>
24)
25
26render(
27 <Provider store={store} key="provider">
28 { main }
29 </Provider>,
30 document.querySelector('main')
31)
32
33if (process.env.NODE_ENV === 'development') {
34 const DevTools = require('app/components/dev-tools')
35
36 render(
37 <Provider store={store} key="provider">
38 <div>
39 { main }
40 <DevTools />
41 </div>
42 </Provider>,
43 document.querySelector('main')
44 )
45}
46

Built with git-ssb-web