Skip to content

Instantly share code, notes, and snippets.

@anupkgurung
Created July 6, 2022 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anupkgurung/8cddd4b665e89f4a25aaf36d3f5c12f6 to your computer and use it in GitHub Desktop.
Save anupkgurung/8cddd4b665e89f4a25aaf36d3f5c12f6 to your computer and use it in GitHub Desktop.
export const ComponentA = () => {
const [counter, setCounter] = useState(0)
const handleAdd = ()=>setCounter(counter => counter+1)
return (
<>
<div><b>i am the at {counter} counter</b></div>
<button onClick={handleAdd}>Add One</button>
</>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment