Skip to content

Commit

Permalink
my first hello world with ReactJS!
Browse files Browse the repository at this point in the history
  • Loading branch information
pigr2 committed Sep 19, 2016
0 parents commit a8839d5
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
13 changes: 13 additions & 0 deletions App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

class App extends React.Component {
render() {
return (
<div>
hello World!!!
</div>
);
}
}

export default App;
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>React App</title>
</head>

<body>
<div id="app"></div>
<script src="index.js"></script>
</body>

</html>
5 changes: 5 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.jsx';

ReactDOM.render(<App />, document.getElementById('app'));
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "react-first-app",
"version": "0.0.1",
"description": "my first react app",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --hot",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.3.1",
"react-dom": "^15.3.1",
"webpack": "^2.1.0-beta.22",
"webpack-dev-server": "^1.16.1"
}
}
29 changes: 29 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var config = {
entry: './main.js',

output: {
path:'./',
filename: 'index.js',
},

devServer: {
inline: true,
port: 8080
},

module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',

query: {
presets: ['react']
}
}
]
}
}

module.exports = config;

0 comments on commit a8839d5

Please sign in to comment.