Skip to content

Commit

Permalink
Started setting up react
Browse files Browse the repository at this point in the history
  • Loading branch information
Algram committed Aug 28, 2016
1 parent 94a2a75 commit 54de219
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "airbnb",
"rules": {
"comma-dangle": ["error", "never"],
"no-console": ["error", {"allow": ["log"]}]
"no-console": ["error", {"allow": ["log"]}],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ node_modules

# Exclude config
config.json

build
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --content-base build --hot --inline",
"start": "webpack-dev-server --content-base src --hot --inline",
"build": "webpack --progress --colors",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -18,7 +19,9 @@
},
"homepage": "https://github.com/Algram/ytdl-webserver#readme",
"dependencies": {
"hapi": "^15.0.1"
"hapi": "^15.0.1",
"react": "^15.3.1",
"react-dom": "^15.3.1"
},
"devDependencies": {
"babel-core": "^6.14.0",
Expand All @@ -30,8 +33,6 @@
"eslint-plugin-import": "^1.14.0",
"eslint-plugin-jsx-a11y": "^2.2.0",
"eslint-plugin-react": "^6.1.2",
"react": "^15.3.1",
"react-dom": "^15.3.1",
"webpack": "^1.13.2",
"webpack-dev-server": "^1.15.0"
}
Expand Down
11 changes: 11 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Webpack, ES6, React, Hot!!</title>
</head>
<body>
<div id="app"></div>
<script src="bundle.js"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* global document */

import React, { PropTypes } from 'react';
import { render } from 'react-dom';

class Hello extends React.Component {
componentDidMount() {
console.log('asdasd');
}

render() {
return (
<div>Hello {this.props.name}
<h1>{this.props.headline}</h1>
</div>
);
}
}

Hello.propTypes = {
name: PropTypes.string,
headline: PropTypes.string
};

render(
<Hello name="somewename" headline="adsuiasd" />, document.getElementById('app'));

0 comments on commit 54de219

Please sign in to comment.