Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Dec 17, 2024
2 parents a6d86dd + cba901d commit 6725ee5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/concepts/components/props.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Instead, you should access props directly from the `props` object, or wrap them

```typescript
function MyComponent(props) {
const name = props.name; // ❌: breaks reactivity and will not update when the prop value changes
const { name } = props; // ❌: breaks reactivity and will not update when the prop value changes
const name = props.name; // ❌: another example of breaking reactivity
const name = () => props.name; // ✓: by wrapping `props.name` into a function, `name()` always retrieves its current value
}
```
Expand Down

0 comments on commit 6725ee5

Please sign in to comment.