-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentry.js
39 lines (32 loc) · 1.07 KB
/
entry.js
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
37
38
39
/**
* CANNOT use `import` to import `es5-shim`,
* because `import` will be transformed to `Object.defineProperty` by babel,
* `Object.defineProperty` doesn't exists in IE8,
* (but will be polyfilled after `require('es5-shim')` executed).
*/
require('es5-shim');
require('es5-shim/es5-sham');
/**
* CANNOT use `import` to import `react` or `react-dom`,
* because `import` will run `react` before `require('es5-shim')`.
*/
// import React from 'react';
// import ReactDOM from 'react-dom';
const React = require('react');
const ReactDOM = require('react-dom');
const {Home} = require('./component/module');
const {User} = require('./component/user');
const {HomePage} = require('./component/App');
//import { IndexRoute } from 'react-router'
const{ Router, Route, IndexRoute } = require('react-router');
const { render } = ReactDOM;
ReactDOM.render((
<Router>
<Route path="/" component={HomePage}>
<Route path="home" component={Home} />
<Route path="user" component={User} />
</Route>
</Router>
),
document.getElementById('app')
);