Skip to content

Commit

Permalink
Change and use es6 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
brice committed Feb 6, 2016
1 parent cc67717 commit bba6d60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "watchify -t [ babelify --presets [ react ] ] ./src/index.js -o ./build/bundle.js"
"watch": "watchify -t [ babelify --presets [ react es2015 ] ] ./src/index.js -o ./build/bundle.js"
},
"repository": {
"type": "git",
Expand All @@ -22,12 +22,13 @@
},
"homepage": "https://github.com/MontpellierJS/react-intro#readme",
"dependencies": {
"babel-preset-react": "^6.3.13",
"babelify": "^7.2.0",
"react": "^0.14.6",
"react-dom": "^0.14.6"
},
"devDependencies": {
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babelify": "^7.2.0",
"watchify": "^3.7.0"
}
}
8 changes: 3 additions & 5 deletions src/components/TodoApp.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
var React = require('react');
import React from 'react'

function TodoApp(props) {
export default function TodoApp(props) {
return (
<div className="todoApp">
Todo : Build The App
</div>
);
)
}

module.exports = TodoApp;
12 changes: 4 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
var React = require('react');
var ReactDOM = require('react-dom');
import React from 'react'
import { render } from 'react-dom'
import TodoApp from './components/TodoApp'

var TodoApp = require('./components/TodoApp.js');

ReactDOM.render(
<TodoApp/>,
document.getElementById('app')
);
render((<TodoApp/>),document.getElementById('app'))

0 comments on commit bba6d60

Please sign in to comment.