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
I am using inside hooks the useEffect for componentDidMount. Additionally I have a useContext.
I am calling a function via the context for changing a state with a given param.
Although this works fine, I get a warning inside the console which looks like following:
React Hook useEffect has a missing dependency: 'langContext'. Either include it or remove the dependency array react-hooks/exhaustive-deps
I tried many things from other issues but nothing worked for me.
The linter is telling you that you're depending on external values that may change, when you set the dependencies as an empty array the effect will run just once when the component mounts.
Is this a bug report?
No
Issue
I am using inside hooks the useEffect for componentDidMount. Additionally I have a useContext.
I am calling a function via the context for changing a state with a given param.
Although this works fine, I get a warning inside the console which looks like following:
React Hook useEffect has a missing dependency: 'langContext'. Either include it or remove the dependency array react-hooks/exhaustive-deps
I tried many things from other issues but nothing worked for me.
Code
Question
My question is, is this an actual error or a linting problem and how do I fix this warning?
Thanks in advance.
The text was updated successfully, but these errors were encountered: