Description
Vue version
3.2.45
Link to minimal reproduction
Steps to reproduce
Observe the output – the two lines should be identical, but they are not.
What is expected?
data
is a shallowRef
holding an array.
There is a setInterval
that updates an array element, then triggers the data
shallowRef.
The two lines of output should be the same – the first is the direct output of the App template and the second is the output of a nested Canvas component.
What is actually happening?
For some reason, despite the triggerRef
calls, the reactivity does not propagate to the Canvas component instance.
System Info
No response
Any additional comments?
Curiously, if I pass the prop as :data='[data]'
instead of :data='data'
, then the two stay in sync.
I think this means that triggerRef causes the data prop to re-evaluate, and since each evaluation returns a new array object ([data]
) this causes the Canvas component to be re-rendered.
But I think that data changing should be enough to cause the Canvas component to re-render, and it is puzzling why it doesn't.