Heya! I just updated from 0.5.0 to 0.6.1 and noticed a new warning popping up:
[Vue warn]: toRefs() expects a reactive object but received a plain one.
I noticed this is caused by code like
export default defineComponent({
props: {
whatever: String,
},
setup(props) {
const { whatever } = toRefs(props);
}
});
That pattern has been working wonderfully before, and I was under the impression that props was in fact a reactive object, which in turn would mean toRefs(props) should be valid.
Is this a bug, or am I misunderstanding the reactivity of the props parameter?
Is this a bug, or am I misunderstanding the reactivity of the
propsparameter?
It shouldn't warn when using props, props are reactive. I will create a PR to fix that
Thanks for the impressively fast turnaround on this @pikax & @antfu! Y'all rock 鉂わ笍
Most helpful comment
It shouldn't
warnwhen usingprops,propsare reactive. I will create a PR to fix that