UNPKG

wpsjs

Version:

用于开发wps加载项的工具包

30 lines (26 loc) 892 B
import React from 'react'; import ReactDOM from 'react-dom'; import { HashRouter, Route, Switch } from 'react-router-dom'; import App from './components/app'; import Dialog from './components/dialog'; import TaskPane from './components/taskpane'; import { Provider } from 'react-redux'; import { createStore } from "redux"; import rootReducer from './reducers'; if (window.location.hash === "" || window.location.hash === "#/") { import('./js/functions'); } const store = createStore(rootReducer, window.STATE_FROM_SERVER); ReactDOM.render(( <Provider store={store}> <HashRouter> <Switch> <Route path="/" exact component={App} /> <Route path="/dialog" exact component={Dialog} /> <Route path="/taskpane" exact component={TaskPane} /> </Switch> </HashRouter> </Provider> ), document.getElementById("root") );