Skip to content

Commit 4dfc045

Browse files
Update Prop Mutation Docs to be more clear around mutation (#1365)
* Update Prop Mutation Docs to be more clear around mutation * Update src/guide/component-props.md Co-authored-by: Natalia Tepluhina <[email protected]>
1 parent 423e949 commit 4dfc045

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/guide/component-props.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ computed: {
154154
}
155155
```
156156

157-
::: tip Note
158-
Note that objects and arrays in JavaScript are passed by reference, so if the prop is an array or object, mutating the object or array itself inside the child component **will** affect parent state.
157+
::: warning Warning
158+
Note that objects and arrays in JavaScript are passed by reference, so if the prop is an array or object, mutating the object or array itself inside the child component **will** affect the parent state and Vue is unable to warn you against this. As a general rule, you should avoid mutating any prop, including objects and arrays as doing so ignores one-way data binding and may cause undesired results.
159159
:::
160160

161161
## Prop Validation

0 commit comments

Comments
 (0)