Fix confusion around Activity with text children (#8304)

This commit is contained in:
Sebastian "Sebbie" Silbermann
2026-02-12 11:30:46 +01:00
committed by GitHub
parent 46e040e4e6
commit a19c98de4e

View File

@@ -48,7 +48,7 @@ In this way, Activity can be thought of as a mechanism for rendering "background
#### Caveats {/*caveats*/}
- If an Activity is rendered inside of a [ViewTransition](/reference/react/ViewTransition), and it becomes visible as a result of an update caused by [startTransition](/reference/react/startTransition), it will activate the ViewTransition's `enter` animation. If it becomes hidden, it will activate its `exit` animation.
- An Activity that just renders text will not render anything rather than rendering hidden text, because theres no corresponding DOM element to apply visibility changes to. For example, `<Activity mode="hidden"><ComponentThatJustReturnsText /></Activity>` will not produce any output in the DOM for `const ComponentThatJustReturnsText = () => "Hello, World!"`.
- A *hidden* Activity that just renders text will not render anything rather than rendering hidden text, because theres no corresponding DOM element to apply visibility changes to. For example, `<Activity mode="hidden"><ComponentThatJustReturnsText /></Activity>` will not produce any output in the DOM for `const ComponentThatJustReturnsText = () => "Hello, World!"`. `<Activity mode="visible"><ComponentThatJustReturnsText /></Activity>` will render visible text.
---