Skip to content

How to fetch on server before rendering? #1421

Answered by lxsmnsyc
Torsten85 asked this question in Q&A
Discussion options

You must be logged in to vote

Adding deferStream to a resource should allow the resource to block the SSR before sending the initial HTML.

const [data] = createResource(fetchData, {
  deferStream: true,
});

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Torsten85
Comment options

Comment options

You must be logged in to vote
1 reply
@Torsten85
Comment options

Answer selected by Torsten85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants