Skip to content

RTK Query and Next 13 app dir / React Server components: status and discussion #3508

@markerikson

Description

@markerikson

We're getting a lot of questions about whether RTK Query works with RSCs.

Quoting Lenz at https://twitter.com/phry/status/1666553972075687938 :

There's a lot of nuance. In client components, it effectively already works, but not for SSR. In RSC, it's probably not a particularly useful/good idea. In Client component SSR we need support for two things: streaming SSR data transport and a good suspense story.

Of those last two things, the first right now can only be solved in a very unsatisfying way with a Next-specific api. The latter would probably build on top of use, but it would be a "temporary" api design until React would add use support for observables (if they ever do).

We're also looking at tweaking RTKQ + React-Redux to not throw errors related to calling createContext in an RSC environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RTK-QueryIssues related to Redux-Toolkit-QuerydiscussionA status update or open-ended community conversation.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions