|
@ -54,7 +54,7 @@ function Counter({initialCount}) { |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
Count: {count} |
|
|
Count: {count} |
|
|
<button onClick={() => setCount(0)}>Reset</button> |
|
|
<button onClick={() => setCount(initialCount)}>Reset</button> |
|
|
<button onClick={() => setCount(prevCount => prevCount + 1)}>+</button> |
|
|
<button onClick={() => setCount(prevCount => prevCount + 1)}>+</button> |
|
|
<button onClick={() => setCount(prevCount => prevCount - 1)}>-</button> |
|
|
<button onClick={() => setCount(prevCount => prevCount - 1)}>-</button> |
|
|
</> |
|
|
</> |
|
|