Skip to content

Upgrades react-query to v5 #1703

Open
alexanderpaolini wants to merge 14 commits into
ucfopen:dev/11.1.0from
alexanderpaolini:issue/1640-react-query-upgrade
Open

Upgrades react-query to v5 #1703
alexanderpaolini wants to merge 14 commits into
ucfopen:dev/11.1.0from
alexanderpaolini:issue/1640-react-query-upgrade

Conversation

@alexanderpaolini
Copy link
Copy Markdown
Contributor

Closes #1640

This PR upgrades react-query to v5. The react-query docs has a page on migrating to v5, and a page on v3 to v4.

The most important changes to watch for in this PR are:

  • Changing import from react-query to @tanstack/react-query
  • Changing keys from strings to arrays
  • Removing callbacks from useQuery. Note that callbacks are still okay for useMutation
  • Handling errors correctly by checking statuses

@alexanderpaolini alexanderpaolini changed the base branch from master to dev/11.0.1 April 8, 2026 13:38
@alexanderpaolini
Copy link
Copy Markdown
Contributor Author

alexanderpaolini commented Apr 8, 2026

I'm using this comment to keep track of what has been done and what has been tested. Trivial changes like renaming the import do not apply.

File Description of change Has it been tested? Comments (optional)
widget-admin-page.jsx Removed callback and added useMemo for data normalization Basic
user-admin-page.jsx Removed onError callback and added useEffect for redirect Basic
settings-page.jsx Removed onError callback, added useEffect to display issue Basic
support-page.jsx Removed onError callback, added useEffect for redirect Basic
profile-page.jsx Removed onError callback, added useEffect to display issue Basic
widget-player.jsx Implemented new changes with funky mapping. Basic Very funky. Need to get this approved for sure
extra-attempts-dialog.jsx same as widget-player.jsx No Not sure how to test
media-importer.jsx Implemented new changes. Used useMemo for data normalization No Not sure how to test
my-widgets-collaborate-dialog.jsx Removed onError and onSuccess Basic
my-widgets-page.jsx Removed onError and joined two error states Basic
my-widgets-score-semester-individual.jsx Removed onError and onSuccess callback. Added useEffect to change state No Not sure how to test
my-widgets-score-semester-storage.jsx Removed onError and added status handling No Not sure how to test
my-widgets-scores.jsx same as above No Not sure how to test
question-history.jsx Removed error state handling and moved to useEffect No Not sure how to test
support-selected-instance.jsx Removed onError and moved to useEffect No Not sure how to test

@alexanderpaolini
Copy link
Copy Markdown
Contributor Author

I want to note that some of the hooks that were labeled as optimistic (namely useUpdateUserRoles) in comments, but they didn't seem to be. I'm not 100% sure on how to implement these, or if its necessary.

@alexanderpaolini alexanderpaolini marked this pull request as ready for review April 16, 2026 13:21
@clpetersonucf clpetersonucf changed the base branch from dev/11.0.1 to dev/11.1.0 May 12, 2026 15:37
@clpetersonucf clpetersonucf added Rework This pull request reworks or updates an existing feature. Awaiting Review Requires a reviewer to test and review code labels May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting Review Requires a reviewer to test and review code Rework This pull request reworks or updates an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update react query to v5 and overhaul useQuery references

2 participants