mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-12 16:57:39 -05:00
25 lines
824 B
JavaScript
25 lines
824 B
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import { Provider } from 'react-redux'
|
|
import { Route, Switch } from 'react-router' // react-router v4/v5
|
|
import { ConnectedRouter } from 'connected-react-router'
|
|
import configureStore, { history } from './app/configureStore'
|
|
|
|
import App from './App';
|
|
|
|
|
|
const store = configureStore(/* provide initial state if any */)
|
|
|
|
ReactDOM.render(
|
|
<Provider store={store}>
|
|
<ConnectedRouter history={history}> { /* place ConnectedRouter under Provider */ }
|
|
<> { /* your usual react-router v4/v5 routing */ }
|
|
<Switch>
|
|
<Route exact path="/" render={() => (<App />)} />
|
|
<Route render={() => (<div>Miss</div>)} />
|
|
</Switch>
|
|
</>
|
|
</ConnectedRouter>
|
|
</Provider>,
|
|
document.getElementById('root')
|
|
) |