hey @localvoid think i found a bug?
i'd like to use useLayoutEffect to measure the rendered DOM. i expcted it to fire once the DOM has been flushed/synced. but it fires before anything is rendered.
useLayoutEffect(c, () => {
console.log('useLayoutEffect!');
})();
however, if i add a useEffect above it, then the useEffect fires after the DOM has been flushed/synced, then useLayoutEffect also fires.
useEffect(c, () => {
console.log('useEffect!');
})();
useLayoutEffect(c, () => {
console.log('useLayoutEffect!');
})();
- i did not expect useLayoutEffect to fire before DOM sync
- i did not expect useEffect to affect useLayoutEffect
hey @localvoid think i found a bug?
i'd like to use
useLayoutEffectto measure the rendered DOM. i expcted it to fire once the DOM has been flushed/synced. but it fires before anything is rendered.however, if i add a
useEffectabove it, then theuseEffectfires after the DOM has been flushed/synced, thenuseLayoutEffectalso fires.