Skip to content

Instantly share code, notes, and snippets.

@masious
Created September 29, 2023 03: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 masious/75270603cf59da9ca7eefb885416294a to your computer and use it in GitHub Desktop.
Save masious/75270603cf59da9ca7eefb885416294a to your computer and use it in GitHub Desktop.
How would be the performance of this code?
function SlowLogger({ value = [] }) {
const cb = useCallback(() => {
console.log(value)
}, [value])
return (
<div onClick={cb}>
Log the array to the console!
</div>
)
}
function App() {
return <SlowLogger />
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment