Skip to content

Instantly share code, notes, and snippets.

@masious
Created September 29, 2023 01:48
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 masious/88ed66eaf462296ce19dc84acebecec6 to your computer and use it in GitHub Desktop.
Save masious/88ed66eaf462296ce19dc84acebecec6 to your computer and use it in GitHub Desktop.
example of an un-memoized callback
function MyHeavyComponent() {
const [counter, setCounter] = useState(0);
return (
<button onClick={() => setCounter(counter + 1)}>Hit me</button>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment