react-benchmark
react-benchmark copied to clipboard
feat: add onReady feature
Adds a special --onReady
flag.
Measure time not until the first render, but until onReady
callback is not invoked from the component. Useful when you have something happening inside your component after the initial render. If enabled, a special onReady
function is passed to the component as a prop, which can be called after the component has done all the initial tasks, for example:
// Your component
const FooComponent = ({ onReady }) => {
useEffect(() => {
doSomeHeavyCalculations().finally(() => onReady())
}, [])
return ()
}
Tests are failing nevertheless they pass locally, will check tomorrow