Resolve #53
This commit is contained in:
@ -2,9 +2,9 @@
|
||||
|
||||
Renders a ticker component.
|
||||
|
||||
Use the `React.useState()` hook to initialize the `ticker` state variable to `0`.
|
||||
Define two methods, `tick` and `reset`, that will periodically increment `timer` based on `interval` and reset `interval` respectively.
|
||||
Return a `<div>` with two `<button>` elements, each of which calls `tick` and `reset` respectively.
|
||||
* Use the `React.useState()` hook to initialize the `ticker` state variable to `0`.
|
||||
* Define two methods, `tick` and `reset`, that will periodically increment `timer` based on `interval` and reset `interval` respectively.
|
||||
* Return a `<div>` with two `<button>` elements, each of which calls `tick` and `reset` respectively.
|
||||
|
||||
```jsx
|
||||
function Ticker(props) {
|
||||
@ -41,3 +41,4 @@ ReactDOM.render(<Ticker times={5} interval={1000} />, document.getElementById('r
|
||||
<!-- tags: visual,state -->
|
||||
|
||||
<!-- expertise: 1 -->
|
||||
*
|
||||
Reference in New Issue
Block a user