Problem Statement
When do shallowRef and markRaw help performance?
Explanation
Use shallowRef for large objects you don’t want deeply reactive (e.g., chart instances). Use markRaw to prevent Vue from making objects reactive (3rd-party libs). This avoids unnecessary dependency tracking and reactivity overhead.
Code Solution
SolutionRead Only
const chart = shallowRef() chart.value = markRaw(new EChartsInstance())