Skip to content

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

Open

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions