Support hooks and eslint-rule react-hooks/exhaustive-deps
complete
Trond Bergquist
Passing props in componentDidMount/DidUpdate with navigation.setParams is a much used feature.
Now that hooks are released, the better way of doing this is with React.useEffect. There is an eslint-rule ensuring best practices with this hook, react-hooks/exhaustive-deps.
Now, using navigation.setParams in the hook, this eslint rule wants us to add navigation to the array of props to track.
The issue is that navigation changes it self, causing endless re-renders.
I don't want to deactivate this eslint-rule either, since it is quite useful.
satya164
complete
React Navigation 5 has proper support for hooks.
Jérémie B.
Hi, this poses a particular problem for beginners like me who are trying to implement getting started while following the Hooks documentation. Some time to understand the problem with Linter.