From e15542ee0f9c5ef5646820d59bde3a282e107d02 Mon Sep 17 00:00:00 2001 From: Alexey Raspopov Date: Mon, 11 Feb 2019 09:41:37 -0500 Subject: [PATCH] use functional component as a first example in readme (#14819) --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1cf0009202..808ad63cf3 100644 --- a/README.md +++ b/README.md @@ -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
Hello {this.props.name}
; - } +function HelloMessage({ name }) { + return
Hello {name}
; } ReactDOM.render(