Skip to content

Investigate hydration with Suspense and undefined fallback #46

@theKashey

Description

@theKashey

original issue

facebook/react#16938

test which explains everything

https://github.com/facebook/react/pull/16945/files#diff-ab371863932cd2e8f0ba14ff2eaab380R687


Mostly for your information.

The last React version which will work out of the box with the provided examples API is 16.9. After that one has to use <Suspense fallback={undefined}> during the hydration, or it will fail.

In other words this moment might be changed a little - renderFallback should return undefined during hydration

<Suspense fallback={this.renderFallback(false)}>
{this.props.children}
</Suspense>

Questions yet to answer

  • can one render Suspense first time without fallback and add it using useEffect a render tick later?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions