-
Notifications
You must be signed in to change notification settings - Fork 109
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
React query implementation #2087
base: master
Are you sure you want to change the base?
React query implementation #2087
Conversation
@bharateshwq I just wanted to confirm with you: is this still a work in progress, or ready for review? Thanks for your work on this. |
Hey @anth-volk, I believe it would be better to avoid merging the migration to React Query for all pages in a single PR. Instead, how about we split this issue into multiple PRs? We could create tasks on GitHub similar to this example. This would allow for a more manageable, long-running set of tasks, and you can decide if it’s necessary. As for this PR, it’s ready for review! |
I completely agree. If you'd like to modify the existing issue to break this up however you'd like, please be my guest. With regard to this PR, would you mind fixing the merge conflicts before I review? If you'd like, I can take them on, but don't want to incorrectly change any of your code additions. |
yeah sure |
Hey @anth-volk , |
@bharateshwq Sure, I'll connect with you on LinkedIn (via the link present on your GitHub account) and send a link to our Slack, if that works for you. |
Description
Fixes #2074
This is still a work in progress.
The API calls on the first page are now managed using react-query. I’ve created three hooks:
usePolicy
(for baseline and reform),useMetadata
, anduseUserProfile
, which completely eliminate prop drilling and allow data to be accessed wherever it's needed.Currently, I'm caching the data for three minutes.
I plan to implement react-query for additional API calls in the PolicyPage and HouseholdPage, as I’ve already noticed a slight improvement in the Lighthouse performance rating for the site after my changes.