3 ms·
there is an eslint rule exhaustive-deps which really helps with this
by darepublic 4y ago
there is an eslint rule exhaustive-deps which really helps with this
- systoll 4y agoFor useMemo and useCallback, Typescript and exhaustive-hooks will both tell you to add a dependency array, because without it those hooks do nothing. For useEffect, exhaustive-hooks & Typescript say nothing, because a non-memoised Effect is a reasonable thing to write. It’s just not a great thing to write accidentally.