Skip to content

Commit a4802e9

Browse files
vanillajonathanDustin Masters
authored andcommitted
Change class component to function component (reactjs#810)
1 parent 24685fa commit a4802e9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ Create JSX files
3535

3636
```javascript
3737
// /Scripts/HelloWorld.jsx
38-
class HelloWorld extends React.Component {
39-
render() {
40-
return <div>Hello {this.props.name}</div>;
41-
}
42-
}
38+
const HelloWorld = (props) => {
39+
return (<div>Hello {props.name}</div>);
40+
};
4341
```
4442

4543
Reference the JSX files from your HTML

0 commit comments

Comments
 (0)