-
Notifications
You must be signed in to change notification settings - Fork 50.6k
Closed
reactjs/react.dev
#8304Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
React version:
v19.2.0
Steps To Reproduce
- Render
<Activity>Hello, World!</Activity>
<Activity>
Hello, World!
</Activity>- Render
<Activity><ComponentThatJustReturnsText /></Activity>
const ComponentThatJustReturnsText = () => "Hello, World!";
<Activity>
<ComponentThatJustReturnsText />
</Activity>- Regardless of whether the mode prop is provided or not, both plain text and components that return only text are rendered in the DOM.
Link to code example:
Reproducible with a minimal example using only React (no additional dependencies).
The current behavior
Text-only children inside <Activity /> are rendered correctly in the DOM.
- Passing a plain string (
"Hello, World!") directly works as expected. - Passing a component that returns only a string also renders without issues.
- The
modeprop still behaves correctly, and visibility changes are applied as expected.
The expected behavior
According to the official documentation:
An Activity that just renders text will not render anything rather than rendering hidden text,
because there’s no corresponding DOM element to apply visibility changes to.
For example, will not produce any output in the DOM for const ComponentThatJustReturnsText = () => "Hello, World!";.
Based on this description, text-only children should not produce any DOM output. However, in practice, they are rendered normally.
Related link
React documentation:
https://react.dev/reference/react/Activity#caveats
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug