-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
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
Metadata
Metadata
Assignees
Labels
No labels