Skip to content

React Router 6 Loaders with RTK Query #2751

Answered by phryneas
spacepolice10 asked this question in Q&A
Discussion options

You must be logged in to vote

That said, you can also unwrap the result of initiate and should probably also unsubscribe the subscription that initiate call creates.

Also, it's probably an option to have the loader just initiate (and immediately unsubscibe after success) and use the hook in the component, which would at that point be prepopulated but also allows access to refetch etc.

Replies: 7 comments 14 replies

Comment options

You must be logged in to vote
0 replies
Comment options

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

@FabianFrank
Comment options

@FabianFrank
Comment options

Answer selected by spacepolice10
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
11 replies
@ChristophP
Comment options

@ChristophP
Comment options

@ChristophP
Comment options

@codeart1st
Comment options

@codeart1st
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants