Skip to content

Instantly share code, notes, and snippets.

@myogeshchavan97
Last active April 25, 2021 05:42
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 myogeshchavan97/a8504e5c9582443db0dcc46831f15bba to your computer and use it in GitHub Desktop.
Save myogeshchavan97/a8504e5c9582443db0dcc46831f15bba to your computer and use it in GitHub Desktop.
Updated Counter
const App = () => {
const inputRef = useRef(0);
const handleClick = () => {
inputRef.current++;
console.log("count", inputRef.current);
};
return (
<div>
<Header />
<input type="button" onClick={handleClick} value="Increment" />
<Content />
</div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment