Skip to content

Commit b5baf2a

Browse files
committed
updated 01 Hello React
1 parent b9a2120 commit b5baf2a

File tree

12 files changed

+67
-74
lines changed

12 files changed

+67
-74
lines changed

01 HelloReact/.babelrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

01 HelloReact/package.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

01_HelloReact/.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"useBuiltIns": "entry"
7+
}
8+
]
9+
]
10+
}

01_HelloReact/package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "reactbysample",
3+
"version": "1.0.0",
4+
"description": "In this sample we setup the basic plumbing to \"build\" our project and launch it in a dev server.",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "webpack-dev-server --mode development --inline --hot --open",
8+
"build": "webpack --mode development",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"author": "",
12+
"license": "ISC",
13+
"devDependencies": {
14+
"@babel/cli": "^7.1.2",
15+
"@babel/core": "^7.1.2",
16+
"@babel/polyfill": "^7.0.0",
17+
"@babel/preset-env": "^7.1.0",
18+
"@types/react": "^16.4.16",
19+
"@types/react-dom": "^16.0.9",
20+
"awesome-typescript-loader": "^5.2.1",
21+
"babel-loader": "^8.0.4",
22+
"css-loader": "^1.0.0",
23+
"file-loader": "^2.0.0",
24+
"html-webpack-plugin": "^3.2.0",
25+
"mini-css-extract-plugin": "^0.4.3",
26+
"style-loader": "^0.23.1",
27+
"typescript": "^3.1.1",
28+
"url-loader": "^1.1.1",
29+
"webpack": "^4.20.2",
30+
"webpack-cli": "^3.1.2",
31+
"webpack-dev-server": "^3.1.9"
32+
},
33+
"dependencies": {
34+
"react": "^16.5.2",
35+
"react-dom": "^16.5.2"
36+
}
37+
}

01 HelloReact/readme.md renamed to 01_HelloReact/readme.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,7 @@ export const HelloComponent = () => {
6868
<h2>Hello component !</h2>
6969
);
7070
}
71-
```
72-
Side note: in ES6, this can written as
73-
74-
```jsx
75-
import * as React from 'react';
76-
77-
export const HelloComponent = () => (
78-
<h2>Hello component !</h2>
79-
);
80-
81-
```
71+
```
8272

8373
- Wire up this component by using `react-dom` under [./src/main.tsx](./src/main.tsx) (we have to rename this file extension from `ts` to `tsx` and replace the content).
8474

File renamed without changes.
File renamed without changes.

01 HelloReact/src/index.html renamed to 01_HelloReact/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ <h1>Sample app</h1>
1010
<div id="root"></div>
1111
</div>
1212
</body>
13-
</html>
13+
</html>

01_HelloReact/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
document.write("Hello from main.ts !");
File renamed without changes.

0 commit comments

Comments
 (0)