git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: d2f38cf414ca1d7105c81ad0e9341cfebafb2bb3

Files: d2f38cf414ca1d7105c81ad0e9341cfebafb2bb3 / app / render-browser.js

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

Built with git-ssb-web