Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove buggy useEffect usage #1316

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

daniel-heppner-ibigroup
Copy link
Contributor

Description:
These useEffect usages were causing bugs. Since useEffect calls its callback any time one of the dependencies change, it can be easy to accidentally introduce unexpected bugs. In this case, the query params changing was causing the dateTime effect to be called, which was setting the itinerary sort when external parameters were changing. In this case, we noticed changing the sort order from the itinerary header was causing the effect to run, immediately overriding the setting.

This is actually a good lesson in why useEffect is dangerous!

Copy link
Collaborator

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

All is working! Thanks for the cleanup

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