Skip to content

Commit 5d5fd38

Browse files
authored
Update caveats for Activity rendering behavior
Clarify behavior of Activity with text nodes in caveats section.
1 parent ef80db8 commit 5d5fd38

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/content/reference/react/Activity.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ In this way, Activity can be thought of as a mechanism for rendering "background
4848
#### Caveats {/*caveats*/}
4949

5050
- 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.
51+
- If an Activity has a text node (plain text) as its child instead of an element, it won’t be rendered at all rather than hidden, because there’s no corresponding DOM node to apply visibility changes to.
5152

5253
---
5354

@@ -1248,4 +1249,4 @@ When an `<Activity>` is "hidden", all its children's Effects are cleaned up. Con
12481249
12491250
If you're relying on an Effect mounting to clean up a component's side effects, refactor the Effect to do the work in the returned cleanup function instead.
12501251
1251-
To eagerly find problematic Effects, we recommend adding [`<StrictMode>`](/reference/react/StrictMode) which will eagerly perform Activity unmounts and mounts to catch any unexpected side-effects.
1252+
To eagerly find problematic Effects, we recommend adding [`<StrictMode>`](/reference/react/StrictMode) which will eagerly perform Activity unmounts and mounts to catch any unexpected side-effects.

0 commit comments

Comments
 (0)