[Vue warn]: injection "Symbol(ssrContext)" not found.
Vue version
3.2.45
Link to minimal reproduction
Steps to reproduce
click button, check console.log
What is expected?
no warning
What is actually happening?
I use reactive + toRefs to create a two way data binding. My parent vnode do all the logic, child vnode exists only for dynamic comp rendering.
several questions:
When I send v-model as a complex data structure, everything's fine, except a warning as below, what does that mean?
I try to build a simple demo in SFC, the result is just as excepted, but also find something naughty.
Why VUE doesn't offically support two way data binding, even though we still have ways to bypass the rule? Are there any side effects to do that?
Also I wish we can change the template before Mounted, so we don't need to face the complexity between parent and children.
System Info
No response
Any additional comments?
No response
Reproduction link doesn't reproduced described error, therefore we have no way of investigating this issue.
The effect in the screenshot is because you have SSR on and the simulated SSR Render is still running its timer. In a real world scenario you would not start a timer in setup on the server, hopefully.
Why VUE doesn't offically support two way data binding, even though we still have ways to bypass the rule? Are there any side effects to do that?
I don't get what you mean. Consider opening a thread in this repository's Discussion Tab.
I have no idea why there's an SSR warning, I didn't use SSR at all. But I cannot reproduced in SFC. Use a timer is just for sample, I got it!
To simplify my question: Will that warning have any affects if I continue to try 2 way data binding, and go to production env.
That warning is not related to "two way data binding" but it certainly is not something to ignore if it happens.
After restart the computer, the warning is gone... But there's another one:
checkout my SFC demo, also removed v-model.