コード例 #1
0
import routes from './Routes'
import { configureStore } from './store'

const { document } = window
const initialState = JSON.parse(document.getElementById('initial-state').innerHTML)
const store = configureStore(initialState)
const history = withScroll(browserHistory, (_prevLoc, { hash }) => (
  !hash
))

const createLocals = (params, {
  dispatch,
  getState
}) => ({
  ...getState(),
  dispatch,
  params
})

const App = createClientApp({
  routes,
  store,
  history,
  createLocals
})

render(
  <App />,
  document.getElementById('mount')
)
コード例 #2
0
import React from 'react'
import { render } from 'react-dom'
import createClientApp from 'boiler-room-runner/client'

import routes from './routes'

import './styles.css'

const App = createClientApp({
  routes
})

render(<App />, document.getElementById('app'))