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
When placing the set function inside of an IIFE (Immediately Invoked Function Expression) inside of other hooks, the plugin misidentifies the set function as it is inside of useEffect, useLayoutEffect, and triggers rules hooks-extra-no-direct-set-state-in-use-effect, hooks-extra-no-direct-set-state-in-use-layout-effect
Reproduction
consttest=useCallback(()=>{setSomething('')// doesn't trigger the rules;(()=>{setSomething('')// trigger the rules})()},[])
Expected behavior
Not trigger hooks-extra-no-direct-set-state-in-use-effect, hooks-extra-no-direct-set-state-in-use-layout-effect