Improved notes
This commit is contained in:
@ -2,7 +2,11 @@
|
|||||||
|
|
||||||
Renders a timer component.
|
Renders a timer component.
|
||||||
|
|
||||||
The timer state is initially set to zero. When the `Tick!` button is clicked, `timer` is incremented periodically at the given `interval`. The `setInterval` is cleared once the desired `time` is reached. `time` and `interval` are the required props.
|
- The timer state is initially set to zero
|
||||||
|
- When the `Tick!` button is clicked, `timer` is incremented periodically at the given `interval`
|
||||||
|
- When the `Reset` button is clicked, the value of the timer is set to zero and the `setInterval` is cleared
|
||||||
|
- The `setInterval` is cleared once the desired `time` is reached
|
||||||
|
- `time` and `interval` are the required props
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
|
|||||||
Reference in New Issue
Block a user