Skip to content

Instantly share code, notes, and snippets.

@myogeshchavan97
Last active April 25, 2021 05:29
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/9df47569092e0579e33945419a8bc94a to your computer and use it in GitHub Desktop.
Save myogeshchavan97/9df47569092e0579e33945419a8bc94a to your computer and use it in GitHub Desktop.
Invalid use of state
const App = () => {
const [count, setCount] = useState(0);
const handleClick = () => {
setCount(count + 1);
};
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