You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- onSuccess can use the latest count without re-running the effect
130
132
onSuccessEvent <- useEffectEvent \data -> do
131
133
onSuccess data count
132
-
134
+
133
135
-- Effect only re-runs when url changes, not when count changes
134
136
useEffect url do
135
137
response <- fetchData url
136
138
onSuccessEvent response
137
139
pure mempty
138
-
140
+
139
141
pure $ R.div_ [ ... ]
140
142
```
141
143
144
+
## React 19.2 Components
145
+
146
+
### Activity
147
+
148
+
The `Activity` component lets you hide and restore the UI and internal state of its children while preserving their state and DOM. Available in `React.Basic.Hooks.Activity`. Requires React 19.2+.
{ mode: if activeTab == "tab1" then Visible else Hidden
159
+
, children: [ tab1Content ]
160
+
}
161
+
, activity
162
+
{ mode: if activeTab == "tab2" then Visible else Hidden
163
+
, children: [ tab2Content ]
164
+
}
165
+
]
166
+
```
167
+
168
+
### ViewTransition (Experimental)
169
+
170
+
The `ViewTransition` component animates DOM elements when they update inside a Transition. Available in `React.Basic.Hooks.ViewTransition`. Requires React canary — this API is unstable and may change.
0 commit comments