Skip to content

Bug / Docs / Question: Handling interrupted suspense boundaries #24959

Closed
@jacob-ebey

Description

@jacob-ebey

In a world where portions of the component tree can hydrate and become intractable with child components still being suspended, does documentation / guidance exist on how to handle these cases?

Example: https://simple-remix-deferred-demo.fly.dev/

Green: Hydrated
Red: Suspended

image

Clicking either of the "Link" elements in the hydrated portion of the page, this will trigger a re-render and causes the suspense boundary to receive an update before it finishes: https://reactjs.org/docs/error-decoder.html/?invariant=421 This isn't an issue in terms of app functionality as implemented as I was under the assumption parent updates from interactive components would be expected, I mean, why wouldn't they?

So I guess there are a few questions I have:

  1. Why does react log this error? Is it an actual error?
  2. Are there implications I can't think of that would cause your average bare bones suspense usage to fall over and that's the reason this message exists?
  3. When you expect updates to happen when boundaries are still suspended, is there a documented way to handle this to avoid this message?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions