Browse Source

L1: first component. Adapted with no builder.

Frederic G. MARAND 7 years ago
commit
b99693c1e8
5 changed files with 46 additions and 0 deletions
  1. 3 0
      .babelrc
  2. 5 0
      .gitignore
  3. 14 0
      index.html
  4. 15 0
      package.json
  5. 9 0
      src/components.js

+ 3 - 0
.babelrc

@@ -0,0 +1,3 @@
+{
+  "presets": ["react", "stage-0"]
+}

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+.idea/
+lib/
+node_modules
+npm-debug.log
+yarn.lock

+ 14 - 0
index.html

@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8">
+    <title>React 1</title>
+  </head>
+  <body>
+    <div id="story-app"></div>
+
+    <script src="node_modules/react/dist/react.js"></script>
+    <script src="node_modules/react-dom/dist/react-dom.js"></script>
+    <script src="lib/components.js"></script>
+  </body>
+</html>

+ 15 - 0
package.json

@@ -0,0 +1,15 @@
+{
+  "dependencies": {
+    "react": "^15.4.1",
+    "react-dom": "^15.4.1"
+  },
+  "devDependencies": {
+    "babel-cli": "^6.18.0",
+    "babel-preset-react": "^6.16.0",
+    "babel-preset-stage-0": "^6.16.0",
+    "chokidar": "^1.6.1"
+  },
+  "scripts": {
+    "build": "babel src -d lib --preset react -w"
+  }
+}

+ 9 - 0
src/components.js

@@ -0,0 +1,9 @@
+class StoryBox extends React.Component {
+  render() {
+    return (<div>Story Box</div>);
+  }
+}
+
+ReactDOM.render(
+  <StoryBox/>, document.getElementById('story-app')
+);