Created
August 7, 2019 13:17
-
-
Save dagron/8f28108a328784339661217029470f6c to your computer and use it in GitHub Desktop.
index.jsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import ReactDOM from "react-dom"; | |
| import { createBrowserHistory } from "history"; | |
| import { Router, Route, Switch, Redirect } from "react-router-dom"; | |
| // core components | |
| import Admin from "layouts/Admin.jsx"; | |
| import RTL from "layouts/RTL.jsx"; | |
| import "assets/css/material-dashboard-react.css?v=1.7.0"; | |
| const hist = createBrowserHistory(); | |
| window.stateApp = {}; | |
| const render = () => { | |
| ReactDOM.render( | |
| <Router history={hist}> | |
| <Switch> | |
| <Route path="/admin" component={Admin} /> | |
| <Route path="/rtl" component={RTL} /> | |
| <Redirect from="/" to="/admin/dashboard" /> | |
| </Switch> | |
| </Router>, | |
| document.getElementById("root") | |
| ); | |
| } | |
| Object.observe(window.stateApp, render); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment