-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
36 lines (29 loc) · 802 Bytes
/
index.js
File metadata and controls
36 lines (29 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react';
import ReactDOM from 'react-dom';
import {UIRouter, UIView, pushStateLocationPlugin} from '@uirouter/react';
import './index.css';
import 'semantic-ui-css/semantic.min.css';
import App from './App';
import Todo from './Todo';
import registerServiceWorker from './registerServiceWorker';
const states = [
{
name: 'home',
url: '/home',
component: App
},
{
name: 'todo',
url: '/todo',
component: Todo
}
];
const config = router => router.urlService.rules.initial({state: 'home'});
const plugins = [pushStateLocationPlugin];
ReactDOM.render(
<UIRouter plugins={plugins} states={states} config={config}>
<UIView />
</UIRouter>,
document.getElementById('root'),
);
registerServiceWorker();