Support for Suspense in RTK Query

See original GitHub issue

Redux Toolkit and RTK Query are awesome, and have really made it easier to get things working quickly and well.

What would be really good though is to have support for the React Suspense API, so that we can render a fallback component whilst data is loading without needing to handle it in-component with the isLoading flag.

It’s not a huge deal, but it just makes things that little bit neater to have a wrapper around the component that handles this instead.

Cheers

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:27
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

11reactions
AndrewCraswellcommented, Jan 9, 2022

Looks like 1.7 released last month, and the suspense is killing me šŸ˜‰

7reactions
phryneascommented, Oct 5, 2021

RTK 1.7 will have the necessary internal changes for that. (see #1277) After that we’ll probably release an external package marked as ā€œunstableā€ with a module for suspense hooks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mark Erikson on Twitter: "Oh wow, this is cool - Twitter
Oh wow, this is cool - Faber Vitale (author of the RTK Query ... a PR to add proof-of-concept Suspense query hook support...
Read more >
Using Suspense and React Query: Tutorial with examples
Suspense simplifies managing loading states in React components, supporting fallbacks in case the component hasn't finished loading yet.
Read more >
API Slices: Utilities | Redux Toolkit
API Slices: Utilities. The API slice object includes various utilities that can be used for cache management, such as implementingĀ ...
Read more >
Will redux be integrating with suspense data fetching? - Reddit
We do hope to potentially integrate Suspense support into RTK Query, but haven't tried to implement that yet.
Read more >
How i can get suspense to work on react 18? - Stack Overflow
Suspense is a very smart paradygm based on fetch-while-render strategy. ... Fetching libraries like react-queris or RTK-query will implementĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found