File tree 3 files changed +10
-13
lines changed
3 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
7
"test" : " echo \" Error: no test specified\" && exit 1" ,
8
- "watch" : " watchify -t [ babelify --presets [ react ] ] ./src/index.js -o ./build/bundle.js"
8
+ "watch" : " watchify -t [ babelify --presets [ react es2015 ] ] ./src/index.js -o ./build/bundle.js"
9
9
},
10
10
"repository" : {
11
11
"type" : " git" ,
22
22
},
23
23
"homepage" : " https://github.com/MontpellierJS/react-intro#readme" ,
24
24
"dependencies" : {
25
- "babel-preset-react" : " ^6.3.13" ,
26
- "babelify" : " ^7.2.0" ,
27
25
"react" : " ^0.14.6" ,
28
26
"react-dom" : " ^0.14.6"
29
27
},
30
28
"devDependencies" : {
29
+ "babel-preset-es2015" : " ^6.3.13" ,
30
+ "babel-preset-react" : " ^6.3.13" ,
31
+ "babelify" : " ^7.2.0" ,
31
32
"watchify" : " ^3.7.0"
32
33
}
33
34
}
Original file line number Diff line number Diff line change 1
- var React = require ( 'react' ) ;
1
+ import React from 'react'
2
2
3
- function TodoApp ( props ) {
3
+ export function TodoApp ( props ) {
4
4
return (
5
5
< div className = "todoApp" >
6
6
Todo : Build The App
Original file line number Diff line number Diff line change 1
- var React = require ( 'react' ) ;
2
- var ReactDOM = require ( 'react-dom' ) ;
1
+ import React from 'react'
2
+ import { render } from 'react-dom'
3
+ import TodoApp from './components/TodoApp'
3
4
4
- var TodoApp = require ( './components/TodoApp.js' ) ;
5
-
6
- ReactDOM . render (
7
- < TodoApp /> ,
8
- document . getElementById ( 'app' )
9
- ) ;
5
+ render ( ( < TodoApp /> ) , document . getElementById ( 'app' ) )
You can’t perform that action at this time.
0 commit comments