useEffect deps for run on mount

given an effect you want to run on mount like:
const publish = () => {…}

useEffect(() => {
publish();
//…
}, []);
const publish = () => {…}

useEffect(() => {
publish();
//…
}, []);
exhaustive deps lint rule requires listing publish. So I have to override or memoize functions and other vars used in context. Is there a reason the linter still tries to enforce this? Just consistency?
1 Reply
InfiniteCodeMonkeyTheorem
its for consistency in my opinion. i override
Want results from more Discord servers?
Add your server