import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
import {Route, Router, Redirect} from 'react-router'
import { createHashHistory } from 'history'
import Home from './page/Home'
import StyleEdit from './page/StyleEdit'

const history = createHashHistory()

function App() {
  return (
    <div className="app">
      <Router history={history}>
        <h1 className='title'>文件管理系统</h1>
        <Route path="/home" component={Home} />
        <Route path="/style/:id" component={StyleEdit} />
        {/* <Redirect from="/:a" to="/home" /> */}
      </Router>
    </div>
  )
}

ReactDOM.render(<App />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
