Skip to content

Provide a prop on <Suspense> to let children mount/unmount instead of changing style #18856

@huozhi

Description

@huozhi

Feature Request

Currently react render children of Suspense with inline style display: none !important, referenced PR. would like to have a prop like mount or sth else to remount the children when suspended state changed.

Example

const Chid = () => 
   // ... 
   return <div>{data}</div>
<Suspense mount fallback={<span>fallback</span>}>
  <Chid />
</Suspense>

the above code will only render fallback component

<span>fallback</span>

instead of

<span>fallback</span>
<div style="display: none !important;">data</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions