Skip to content

Commit

Permalink
chore: improve console warning to distinguish between readonly and re…
Browse files Browse the repository at this point in the history
…active
  • Loading branch information
chenfan0 committed Aug 26, 2023
1 parent 885b823 commit 8abbda7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/reactivity/src/reactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ function createReactiveObject(
) {
if (!isObject(target)) {
if (__DEV__) {
console.warn(`value cannot be made reactive: ${String(target)}`)
console.warn(
`value cannot be made ${isReadonly ? 'readonly' : 'reactive'}: ${String(
target
)}`
)
}
return target
}
Expand Down

0 comments on commit 8abbda7

Please sign in to comment.