Skip to content

Commit e15542e

Browse files
alexeyraspopovgaearon
authored andcommitted
use functional component as a first example in readme (facebook#14819)
1 parent c11015f commit e15542e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ You can improve it by sending pull requests to [this repository](https://github.
4040
We have several examples [on the website](https://reactjs.org/). Here is the first one to get you started:
4141

4242
```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>;
4745
}
4846

4947
ReactDOM.render(

0 commit comments

Comments
 (0)