diff --git a/src/content/reference/react/ViewTransition.md b/src/content/reference/react/ViewTransition.md index 17595bb763e..d754d08b801 100644 --- a/src/content/reference/react/ViewTransition.md +++ b/src/content/reference/react/ViewTransition.md @@ -442,7 +442,7 @@ button:hover { If there's a `
` above ``, no exit/enter animations trigger: -```js [3, 5] +```js {3,7} function Item() { return (
{/* 🚩
above breaks exit/enter */} @@ -473,7 +473,7 @@ If you want to animate a component in and out while preserving its state, or pre ``` -In this example, `Counter` has a counter with internal state. Try incrementing the counter, hiding it, then showing it again. The counter's value is preserved while the sidebar animates in and out: +In this example, `Counter` has a counter with internal state. Try incrementing the counter, hiding it, then showing it again. The counter's value is preserved while `Counter` animates in and out: @@ -574,7 +574,7 @@ function Counter() { -Without ``, the counter would reset to `0` every time the sidebar reappears. +Without ``, the counter would reset to `0` every time it reappears. --- @@ -1235,8 +1235,8 @@ button:hover { This means you might want to avoid wrapper elements in lists where you want to allow the Component to control its own reorder animation: -``` -items.map(item =>
) +```js +items.map(item =>
) ``` The above rule also applies if one of the items updates to resize, which then causes the siblings to resize, it'll also animate its sibling `` but only if they're immediate siblings. @@ -2630,7 +2630,7 @@ export default function Component() { return ( <>
- Fast: {setIsFast(f => !f)}} value={isFast}> + Fast: {setIsFast(f => !f)}} checked={isFast}>