Skip to content

Conversation

@leplatrem
Copy link
Contributor

  • src/components/homepage/AuthForm.tsx
  • src/hooks/collection.ts
  • src/hooks/record.ts
  • src/hooks/session.ts
  • src/hooks/signoff.ts

notifyError(message, error);
}
}, []);
}, [navigate, payload, token]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For useEffect, an empty dependency array is a way of saying "run this once". In our case I think this is correct. See this doc for some more info. There shouldn't be any harm for payload or token though as they won't change. But I would at least remove navigate as that is a reference to another hook.

@alexcottner
Copy link
Contributor

It's very easy to make an infinite re-render loop with useEffect. Sometimes an empty array or using a callback function to retrigger it is better than following the linter rules.

Base automatically changed from 3140-stricter-eslint to master August 4, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants