Skip to content

Help migrating from RTK thunk/reducer to RTKQ #4501

Answered by markerikson
fhanggi asked this question in Q&A
Discussion options

You must be logged in to vote

The general approach would be to:

  • Set up RTKQ
  • Define an RTKQ endpoint that fetches the same data
  • Replace whatever useSelector + useEffect call you have that triggers the current request with the new RTKQ query hook for that endpoint

See the examples here:

Note that you can do manual cache updates if needed:

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@fhanggi
Comment options

@markerikson
Comment options

@fhanggi
Comment options

Answer selected by fhanggi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants