You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user on Reddit pointed out that the Hooks API Reference page section for useEffect doesn't include the deps array in the signature - it's just useEffect(callback). The deps array is only described later on under the heading "Conditionally Firing an Effect".
Similarly, the entry for useLayoutEffect() doesn't even show a signature at all - it just says "the signature is identical to useEffect".
At a minimum, the useEffect signature should show that there's an optional second argument - the deps array. It would also help to show the signature for useLayoutEffect as well.
A user on Reddit pointed out that the Hooks API Reference page section for
useEffect
doesn't include the deps array in the signature - it's justuseEffect(callback)
. The deps array is only described later on under the heading "Conditionally Firing an Effect".Similarly, the entry for
useLayoutEffect()
doesn't even show a signature at all - it just says "the signature is identical touseEffect
".At a minimum, the
useEffect
signature should show that there's an optional second argument - the deps array. It would also help to show the signature foruseLayoutEffect
as well.Reddit link reference: https://www.reddit.com/r/reactjs/comments/b0oh20/usedimensions_a_react_hook_to_measure_dom_nodes/eigiqud/
The text was updated successfully, but these errors were encountered: