We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9924d12 commit 885b823Copy full SHA for 885b823
packages/reactivity/src/baseHandlers.ts
@@ -168,15 +168,16 @@ class MutableReactiveHandler extends BaseReactiveHandler {
168
receiver: object
169
): boolean {
170
let oldValue = (target as any)[key]
171
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
+ const isUnwrappingRef = isRef(oldValue) && !isRef(value)
172
+ if (isReadonly(oldValue) && isUnwrappingRef) {
173
return false
174
}
175
if (!this._shallow) {
176
if (!isShallow(value) && !isReadonly(value)) {
177
oldValue = toRaw(oldValue)
178
value = toRaw(value)
179
- if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
180
+ if (!isArray(target) && isUnwrappingRef) {
181
oldValue.value = value
182
return true
183
0 commit comments