Closed khuongtp closed 8 months ago
That's sadly not how Next currently works when i.e. Suspense
is enabled, and I would even say that this is desired/expected behavior, to get to the behavior you want you can do something like pause: typeof window === 'undefined'
. This is because a NextJS client component is still first rendered on the server and each Suspense
boundary is streamed in.
Hi @JoviDeCroock , is the hook import from @urql/next
somewhat a server action, if so I think it would be great that we have it documented
No, hooks are inherently for client
components and server-actions/server-components are in the /rsc
folder 😅 I know this is confusing in general but this is the paradigm we got from React/Next to work with. use server
means it is always executed on the server and client-components get executed once on the server and then live on the client.
Describe the bug
In the nextjs example, for client component, the useQuery should execute the request from client side
Reproduction
Go to this code sandbox, go to the non-rsc page, open dev tool and see there's no request called https://codesandbox.io/p/sandbox/github/urql-graphql/urql/tree/main/examples/with-next
Urql version
urql ^4.0.6 @urql/next ^1.1.1
Validations