Skip to content

Conversation

@SaivishaalSureshkannan
Copy link
Contributor

@SaivishaalSureshkannan SaivishaalSureshkannan commented Dec 22, 2025

Fixes Join club and Register event transitioning #453

Problem:
The Join/Joined button reverted to its previous label after loading for a brief time period. I believe this is happening due to the stale React query data during refetching. This causes the component to render again using that stale value, resulting in temporary reappearance of the initial label.

Join -> Loading -> Join -> Joined
Joined -> Loading -> Joined -> Join

Solution:
I was able to implement an optimistic UI state for the join button. The button label updates immediately on click by the user and while that action is pending, the UI reflects the expected next state. If there is error, the UI will roll back. This removes that flicker.

Testing:

  • Verified Join -> joined and joined -> join transition on club homepage, specific club page, and the event section.
  • Used throttle to make

@vercel
Copy link

vercel bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
clubs Ready Ready Preview, Comment Dec 25, 2025 1:57am

@TyHil
Copy link
Member

TyHil commented Dec 24, 2025

This works great! Can you do the same thing on the src\components\events\EventRegisterButton.tsx?

@SaivishaalSureshkannan
Copy link
Contributor Author

Hi, I was able to fix the button flicker on the register button on the event section as well.

Copy link
Member

@TyHil TyHil left a comment

Choose a reason for hiding this comment

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

This looks great! Lmk if you're ready to merge

@SaivishaalSureshkannan
Copy link
Contributor Author

Thanks for the review. I am ready to merge.

@TyHil TyHil merged commit 20f4d02 into develop Dec 28, 2025
3 checks passed
@TyHil TyHil deleted the feature/join-button-transition-fix branch December 28, 2025 05:04
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.

Join club and Register event transitioning

3 participants