Subscribe on changes!

h function when use false props accidentally, development will report warn but in production will report error

avatar
Dec 21st 2022

What problem does this feature solve?

development: https://codesandbox.io/s/vue-error-eo90ln-eo90ln?file=/src/Demo.vue (only warn) production: https://vue-h-theta.vercel.app/ (error)

The props attribute of the h function is accidentally passed in false, only a warning is reported in the development environment but an error is reported in the production environment.

https://github.com/vuejs/core/blob/main/packages/runtime-core/src/vnode.ts#L430L433

I don't know if this is reasonable, because the warning is relatively minor, but it is not friendly to report an error directly as soon as it goes online.

I think there is no way to fix this problem and improve the user experience.

I'm just giving my opinion, if you don't think it's necessary to modify it, please close it.

What does the proposed API look like?

repo https://github.com/Talljack/vue-h/blob/main/src/components/Test.vue#L31L33 Here is an example of incorrect usage code.

avatar
Dec 21st 2022

I'm not sure if this is a bug, so I raised an issue as a suggestion, sorry