-
Notifications
You must be signed in to change notification settings - Fork 50.6k
Closed
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
Upgraded eslint-plugin-react-hooks to 4.0.0, it's showing errors on React-Navigation's useFocusEffect hook.
import { useFocusEffect } from '@react-navigation/native';
useFocusEffect(
React.useCallback(() => {
const unsubscribe = API.subscribe(userId, user => setUser(user));
return () => unsubscribe();
}, [userId])
);(example copied from React-Navigation documentation)
The current behavior
Lint error:
React Hook useFocusEffect received a function whose dependencies are unknown. Pass an inline function instead.
The expected behavior
The rules shouldn't check the function because it's not a React useEffect hook.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug