Skip to content

Commit

Permalink
chore(reactivity): improve readonly/reactive warning message (#9095)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfan0 authored May 27, 2024
1 parent 82458b2 commit baa656e
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 @@ -248,7 +248,11 @@ function createReactiveObject(
) {
if (!isObject(target)) {
if (__DEV__) {
warn(`value cannot be made reactive: ${String(target)}`)
warn(
`value cannot be made ${isReadonly ? 'readonly' : 'reactive'}: ${String(
target,
)}`,
)
}
return target
}
Expand Down

0 comments on commit baa656e

Please sign in to comment.