git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: 2a3d6d9180c1bf18cc316abc4dd7bac73115a41c

Files: 2a3d6d9180c1bf18cc316abc4dd7bac73115a41c / app / render-browser.js

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

Built with git-ssb-web