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:
|
||||
|
||||
```jsx
|
||||
class HelloMessage extends React.Component {
|
||||
render() {
|
||||
return <div>Hello {this.props.name}</div>;
|
||||
}
|
||||
function HelloMessage({ name }) {
|
||||
return <div>Hello {name}</div>;
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
|
|
Loading…
Reference in New Issue