Skip to content

Commit 2ab382d

Browse files
Merge branch 'main' into batch-rewrite
2 parents bc50f45 + cba901d commit 2ab382d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes/concepts/components/props.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ Instead, you should access props directly from the `props` object, or wrap them
5656

5757
```typescript
5858
function MyComponent(props) {
59-
const name = props.name; // ❌: breaks reactivity and will not update when the prop value changes
59+
const { name } = props; // ❌: breaks reactivity and will not update when the prop value changes
60+
const name = props.name; // ❌: another example of breaking reactivity
6061
const name = () => props.name; // ✓: by wrapping `props.name` into a function, `name()` always retrieves its current value
6162
}
6263
```

0 commit comments

Comments
 (0)