This change replaces the updated method with clearEffects, hoping with this change to give a better hook test experience, since it introduces a cleaning in stages, this cleaning in stages is designed to support the useLayoutEffect hook.
import { useLayoutEffect, useEffect } from "atomico";
import { createHooks } from "atomico/test-hooks";
const hooks = createHooks();
hooks.load(() => {
useLayoutEffect(() => {
console.log("first!");
});
useLayoutEffect(() => {
console.log("last!");
});
});
// run all useLayoutEffect
const clearLastEffect = hooks.clearEffects();
// run all useEffect
clearLastEffect();
useLayoutEffect
Improves the experience of associating DOM effects dependent on an asynchronous execution, this hook is ideal for computing styles to be processed later by useEffect
New hook api
This change replaces the updated method with clearEffects, hoping with this change to give a better hook test experience, since it introduces a cleaning in stages, this cleaning in stages is designed to support the useLayoutEffect hook.
useLayoutEffect
Improves the experience of associating DOM effects dependent on an asynchronous execution, this hook is ideal for computing styles to be processed later by useEffect
More tests