Skip to content

Commit

Permalink
Step 2: Introduce React
Browse files Browse the repository at this point in the history
  • Loading branch information
hiquest committed Sep 20, 2017
1 parent b092cde commit 115465e
Show file tree
Hide file tree
Showing 6 changed files with 2,712 additions and 58 deletions.
33 changes: 33 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,33 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"react/jsx-uses-vars": [2],
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"semi": [
"error",
"always"
]
}
};
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -4,9 +4,14 @@
"main": "index.js",
"license": "MIT",
"devDependencies": {
"electron": "^1.7.6"
"electron": "^1.7.6",
"electron-prebuilt-compile": "^1.7.6"
},
"scripts": {
"start": "electron index.js"
},
"dependencies": {
"react": "^15.6.1",
"react-dom": "^15.6.1"
}
}
5 changes: 2 additions & 3 deletions src/index.html
Expand Up @@ -5,8 +5,7 @@
<title>ElectroTV</title>
</head>
<body>
<div id='root'>
<h1>Greetings, sir!</h1>
</div>
<div id='root'></div>
<script src='js/bootstrap.js' type='application/javascript'></script>
</body>
</html>
9 changes: 9 additions & 0 deletions src/js/bootstrap.js
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';

import App from './js/components/app';

ReactDOM.render(
React.createElement(App),
document.getElementById('root')
);
5 changes: 5 additions & 0 deletions src/js/components/app.jsx
@@ -0,0 +1,5 @@
import React from 'react';

export default () => (
<div>Hello, React!</div>
);

0 comments on commit 115465e

Please sign in to comment.