Skip to content

Commit 7edb683

Browse files
committed
props demo
1 parent afde841 commit 7edb683

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
React Es6 Webpack Demo
1+
React Props Demo
22
======================
33

4+
Pass value to other component as props.
5+
46
```
57
npm install
68
npm start
79
```
810

9-
Then visit <http://localhost:8080/webpack-dev-server/>, you will see `Hello world` on the page.
10-
11-
If you modify `public/hello.jsx` to change the text, you will see the changes are applied to page instantly.
12-
11+
Then visit <http://localhost:8080/webpack-dev-server/>.

entry.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import ReactDOM from 'react-dom';
44

55
ReactDOM.render(
6-
<Hello />,
6+
<Hello name='Freewind' />,
77
document.getElementById("content")
88
);
99

hello.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React,{Component} from 'react';
33
class Hello extends Component {
44
render() {
55
return <div>
6-
<h1>Hello world</h1>
6+
<h1>Hello {this.props.name}</h1>
77
</div>;
88
}
99
}

0 commit comments

Comments
 (0)