use functional component as a first example in readme (#14819)
Alexey Raspopov committed
Feb 11, 2019 at 09:41 UTC
e15542ee0f9c5ef5646820d59bde3a282e107d02
1 file changed
+2
-4
README.md
+2
-4
@@ -40,10 +40,8 @@ You can improve it by sending pull requests to [this repository](https://github.
40
We have several examples [on the website](https://reactjs.org/). Here is the first one to get you started:
41
42
```jsx
43
-class HelloMessage extends React.Component {
44
- render() {
45
- return <div>Hello {this.props.name}</div>;
46
- }
43
+function HelloMessage({ name }) {
44
+ return <div>Hello {name}</div>;
45
}
46
47
ReactDOM.render(