Skip to content

Suspense fallback remounts when each child resolves #14073

@adwilk

Description

@adwilk

Do you want to request a feature or report a bug?
Not sure if its a bug or a feature request.

What is the current behavior?
The component given as a fallback to Suspense is remounted each time a lazy child resolves.

https://codesandbox.io/s/z6v6x3n1np
This example shows how a fallback component, which counts up, is mounted more than once.

What is the expected behavior?
The fallback is mounted once and is only unmounted when all lazy children are resolved.
In the example the counter would run up to 9.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
react@16.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions