Created
September 22, 2023 10:29
-
-
Save rahulmore01/56ee8dd33178140eb8b3fbec998e9ff7 to your computer and use it in GitHub Desktop.
counter.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import useCounter from './useCounter'; | |
| function Counter() { | |
| const { count, increment, decrement } = useCounter(); | |
| return ( | |
| <div> | |
| <p>Count: {count}</p> | |
| <button onClick={increment}>Increment</button> | |
| <button onClick={decrement}>Decrement</button> | |
| </div> | |
| ); | |
| } | |
| export default Counter; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment