37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import { Provider } from 'mobx-react';
|
|
import { createHashHistory } from 'history';
|
|
import { Router, Route, useRouterHistory } from 'react-router';
|
|
import { RouterStore, syncHistoryWithStore } from 'mobx-react-router';
|
|
|
|
import weaCustomSetting from 'weaCustomSetting';
|
|
|
|
const browserHistory = useRouterHistory(createHashHistory)({
|
|
queryKey: '_key',
|
|
basename: '/',
|
|
});
|
|
|
|
const routing = new RouterStore();
|
|
|
|
const allStore = {
|
|
routing,
|
|
...weaCustomSetting.store,
|
|
};
|
|
|
|
const history = syncHistoryWithStore(browserHistory, allStore.routing);
|
|
window.weaHistory = history;
|
|
|
|
const Root = () => (
|
|
<Provider ecId={`${this && this.props && this.props.ecId || ''}_Provider@9mdklk`} {...allStore}>
|
|
<Router ecId={`${this && this.props && this.props.ecId || ''}_Router@m4swjd`} history={history}>
|
|
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@9qnao8`} path="/" component={props => props.children}>
|
|
{weaCustomSetting.Route}
|
|
</Route>
|
|
</Router>
|
|
</Provider>
|
|
);
|
|
|
|
ReactDOM.render(<Root ecId={`${this && this.props && this.props.ecId || ''}_Root@2vh17j`} />, document.getElementById('container'));
|