use functional component as a first example in readme (#14819)

This commit is contained in:
Alexey Raspopov 2019-02-11 09:41:37 -05:00 committed by Dan Abramov
parent c11015ff4f
commit e15542ee0f
1 changed files with 2 additions and 4 deletions

View File

@ -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(