Skip to content

Instantly share code, notes, and snippets.

@marekpiechut
Created June 22, 2021 10:53
Show Gist options
  • Save marekpiechut/57210407092961ff2d1f66ac08a20b3a to your computer and use it in GitHub Desktop.
Save marekpiechut/57210407092961ff2d1f66ac08a20b3a to your computer and use it in GitHub Desktop.
React-profiler
const App = () => {
const loadData = id => ({ id, value: 'some' })
const [_, setDummy] = useState()
return (
<div className="App">
<button onClick={() => setDummy(Date.now())} />
<SlowComponent
onClick={React.useCallback(() => loadData('dummy'), [])}
/>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment