use functional component as a first example in readme (#14819)
This commit is contained in:
parent
c11015ff4f
commit
e15542ee0f
|
@ -40,10 +40,8 @@ You can improve it by sending pull requests to [this repository](https://github.
|
||||||
We have several examples [on the website](https://reactjs.org/). Here is the first one to get you started:
|
We have several examples [on the website](https://reactjs.org/). Here is the first one to get you started:
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
class HelloMessage extends React.Component {
|
function HelloMessage({ name }) {
|
||||||
render() {
|
return <div>Hello {name}</div>;
|
||||||
return <div>Hello {this.props.name}</div>;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
|
|
Loading…
Reference in New Issue