Skip to content

Instantly share code, notes, and snippets.

@marekpiechut
Created June 22, 2021 10:52
Show Gist options
  • Select an option

  • Save marekpiechut/5aa8806d13a09eb5727fc43cf7849338 to your computer and use it in GitHub Desktop.

Select an option

Save marekpiechut/5aa8806d13a09eb5727fc43cf7849338 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