Skip to content
Discussion options

You must be logged in to vote

Okay, so here's my understanding: On the server, the <Suspense/> renders once initially to register all resource reads that happen in it, and when they've all resolved, it renders the actual children to HTML. Because of the nested .and_then(), posts1 is actually not registered as part of the <Suspense/> on the server, because when it's first rendered posts is still None.

The good news is that it's relatively easy to fix this by matching a bit more manually on the two resources

let posts_view = move || {
    with!(|posts, posts1| {
        match (posts, posts1) {
            (Some(Ok(posts)), Some(Ok(posts1))) => {
                posts.iter().zip(posts1.iter())
                    .map(|(p…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bioinformatist
Comment options

@bioinformatist
Comment options

@gbj
Comment options

gbj Nov 14, 2023
Maintainer

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