File tree Expand file tree Collapse file tree 9 files changed +39
-35
lines changed Expand file tree Collapse file tree 9 files changed +39
-35
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,4 @@ ItemActions.loadItems.preEmit = function(data){
18
18
} , 500 ) ;
19
19
} ;
20
20
21
- module . exports = ItemActions ;
21
+ export default ItemActions ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { Link } from 'react-router' ;
3
3
4
- var Header = React . createClass ( {
4
+ class Header extends React . Component {
5
5
6
6
render ( ) {
7
7
return (
@@ -20,6 +20,6 @@ var Header = React.createClass({
20
20
) ;
21
21
}
22
22
23
- } ) ;
23
+ }
24
24
25
- module . exports = Header ;
25
+ export default Header ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
- var ItemList = React . createClass ( {
4
-
5
- propTypes : {
6
- loading : React . PropTypes . bool ,
7
- items : React . PropTypes . array
8
- } ,
3
+ class ItemList extends React . Component {
4
+
5
+ constructor ( ) {
6
+ super ( ) ;
7
+ }
9
8
10
9
render ( ) {
11
10
var items = this . props . items . map ( item => < li key = { item } > { item } </ li > ) ,
@@ -21,6 +20,11 @@ var ItemList = React.createClass({
21
20
) ;
22
21
}
23
22
24
- } ) ;
23
+ }
24
+
25
+ ItemList . propTypes = {
26
+ loading : React . PropTypes . bool ,
27
+ items : React . PropTypes . array
28
+ }
25
29
26
- module . exports = ItemList ;
30
+ export default ItemList ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from 'react';
2
2
import { RouteHandler } from 'react-router' ;
3
3
import Header from '../components/header.jsx'
4
4
5
- var App = React . createClass ( {
5
+ class App extends React . Component {
6
6
7
7
render ( ) {
8
8
return (
@@ -15,6 +15,6 @@ var App = React.createClass({
15
15
) ;
16
16
}
17
17
18
- } ) ;
18
+ }
19
19
20
- module . exports = App ;
20
+ export default App ;
Original file line number Diff line number Diff line change @@ -3,27 +3,28 @@ import ItemList from '../components/itemList.jsx';
3
3
import ItemStore from '../stores/itemStore' ;
4
4
import ItemActions from '../actions/itemActions' ;
5
5
6
- var Home = React . createClass ( {
6
+ class Home extends React . Component {
7
7
8
- getInitialState ( ) {
9
- return {
8
+ constructor ( props ) {
9
+ super ( props ) ;
10
+ this . state = {
10
11
items : [ ] ,
11
12
loading : false
12
- }
13
- } ,
13
+ } ;
14
+ }
14
15
15
16
componentDidMount ( ) {
16
- this . unsubscribe = ItemStore . listen ( this . onStatusChange ) ;
17
+ this . unsubscribe = ItemStore . listen ( this . onStatusChange . bind ( this ) ) ;
17
18
ItemActions . loadItems ( ) ;
18
- } ,
19
+ }
19
20
20
21
componentWillUnmount ( ) {
21
22
this . unsubscribe ( ) ;
22
- } ,
23
+ }
23
24
24
25
onStatusChange ( state ) {
25
26
this . setState ( state ) ;
26
- } ,
27
+ }
27
28
28
29
render ( ) {
29
30
@@ -34,7 +35,6 @@ var Home = React.createClass({
34
35
</ div >
35
36
) ;
36
37
}
38
+ }
37
39
38
- } ) ;
39
-
40
- module . exports = Home ;
40
+ export default Home ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
- var Info = React . createClass ( {
3
+ class Info extends React . Component {
4
4
5
5
render ( ) {
6
6
return (
@@ -15,6 +15,6 @@ var Info = React.createClass({
15
15
) ;
16
16
}
17
17
18
- } ) ;
18
+ }
19
19
20
- module . exports = Info ;
20
+ export default Info ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
- var NotFound = React . createClass ( {
3
+ class NotFound extends React . Component {
4
4
5
5
render ( ) {
6
6
return (
@@ -11,6 +11,6 @@ var NotFound = React.createClass({
11
11
) ;
12
12
}
13
13
14
- } ) ;
14
+ }
15
15
16
- module . exports = NotFound ;
16
+ export default NotFound ;
Original file line number Diff line number Diff line change @@ -15,4 +15,4 @@ var routes = (
15
15
</ Route >
16
16
) ;
17
17
18
- module . exports = routes ;
18
+ export default routes ;
Original file line number Diff line number Diff line change @@ -35,4 +35,4 @@ var ItemStore = Reflux.createStore({
35
35
36
36
} ) ;
37
37
38
- module . exports = ItemStore ;
38
+ export default ItemStore ;
You can’t perform that action at this time.
0 commit comments