Playground: When console logging a reactive object in watchEffect, it will track the whole object #273
Open
Description
Vue version
all
Link to minimal reproduction
Steps to reproduce
- Open the reproduction link
- Check the console
What is expected?
- Log the object in its initial state
- Don't log the object again after the name property has been changed in the onMounted hook
What is actually happening?
- Log the object in its initial state
- Does log the object again after the name property has been changed in the onMounted hook
System Info
not applicable
Any additional comments?
This happens because the playground monkeypatches console.log
(etc) and in that code, it stringifies all arguments to send them to the iframe's parent window.
This code runs synchronously within the effect, which leads to a deep traversal of the whole reactive proxy and results in the effect tracking all (deeply nested) properties of the object instead of only tracking the ref itself.
Metadata
Assignees
Labels
No labels