1
- import React from 'react/addons'
1
+ import React from 'react'
2
+ import { render } from 'react-dom'
2
3
import { createHistory , useBasename } from 'history'
3
4
import { Router , Route , Link } from 'react-router'
4
5
@@ -9,8 +10,8 @@ const history = useBasename(createHistory)({
9
10
} )
10
11
11
12
class App extends React . Component {
12
- static title = 'Home' ;
13
- static path = '/' ;
13
+ static title = 'Home'
14
+ static path = '/'
14
15
15
16
render ( ) {
16
17
const depth = this . props . routes . length
@@ -24,12 +25,12 @@ class App extends React.Component {
24
25
</ ul >
25
26
</ aside >
26
27
< main >
27
- < ul className = " breadcrumbs-list" >
28
+ < ul className = ' breadcrumbs-list' >
28
29
{ this . props . routes . map ( ( item , index ) =>
29
30
< li key = { index } >
30
31
< Link
31
32
onlyActiveOnIndex = { true }
32
- activeClassName = " breadcrumb-active"
33
+ activeClassName = ' breadcrumb-active'
33
34
to = { item . path || '' } >
34
35
{ item . component . title }
35
36
</ Link >
@@ -45,32 +46,32 @@ class App extends React.Component {
45
46
}
46
47
47
48
class Products extends React . Component {
48
- static title = 'Products' ;
49
- static path = '/products' ;
49
+ static title = 'Products'
50
+ static path = '/products'
50
51
51
52
render ( ) {
52
53
return (
53
- < div className = " Page" >
54
+ < div className = ' Page' >
54
55
< h1 > Products</ h1 >
55
56
</ div >
56
57
)
57
58
}
58
59
}
59
60
60
61
class Orders extends React . Component {
61
- static title = 'Orders' ;
62
- static path = '/orders' ;
62
+ static title = 'Orders'
63
+ static path = '/orders'
63
64
64
65
render ( ) {
65
66
return (
66
- < div className = " Page" >
67
+ < div className = ' Page' >
67
68
< h1 > Orders</ h1 >
68
69
</ div >
69
70
)
70
71
}
71
72
}
72
73
73
- React . render ( (
74
+ render ( (
74
75
< Router history = { history } >
75
76
< Route path = { App . path } component = { App } >
76
77
< Route path = { Products . path } component = { Products } />
0 commit comments