Skip to content

Commit c2acf95

Browse files
committed
Merge pull request #175 from sirreal/patch-1
Use stateless functional component in dumb example
2 parents 07504d5 + 783bbcf commit c2acf95

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

docs/quick-start.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,14 @@ It is advisable that only top-level components of your app (such as route handle
4242
Let’s say we have a `<Counter />` “dumb” component with a number `value` prop, and an `onIncrement` function prop that it will call when user presses an “Increment” button:
4343

4444
```js
45-
import { Component } from 'react';
46-
47-
export default class Counter extends Component {
48-
render() {
49-
return (
50-
<button onClick={this.props.onIncrement}>
51-
{this.props.value}
52-
</button>
53-
)
54-
}
45+
import React from 'react'
46+
47+
export default function Counter(props) {
48+
return (
49+
<button onClick={props.onIncrement}>
50+
{props.value}
51+
</button>
52+
)
5553
}
5654
```
5755

0 commit comments

Comments
 (0)