Skip to content

Instantly share code, notes, and snippets.

@marekpiechut
Created June 22, 2021 10:53
Show Gist options
  • Save marekpiechut/6b177c700b46f2e99be11096fc1e113b to your computer and use it in GitHub Desktop.
Save marekpiechut/6b177c700b46f2e99be11096fc1e113b 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())}>Render</button>
<SlowComponent onClick={() => loadData('dummy')} />
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment