Closed runebaas closed 5 years ago
Hey! Thank you for this PR! I think that touching the prototype is OK for vuera. There's no "proper" way (that I know of) to distinguish between React and Vue components anyway, so I feel that it's totally fine for us to use hacks, and writing to Vue's prototype is better that playing a guessing game with properties that may or may not be in there in different versions.
Please fix the tests, and I will happily merge this!
Awesome, thanks.
The tests are fixed, i've added the same thing to the test setup, because the VuePlugin
is not loaded and the property doesn't exist.
Would you mind creating a new release on NPM with this change please?
Sure, hopefully will publish a new release this evening.
Published 0.2.4 just now.
Thanks! 😄
I also ran in into #48, unknowingly that there is already an issue for it i came to the same conclusion as @stlbucket.
It would be great if this issue would be fixed, i added a property to the prototype to see if a component is a vue component to make sure that there are no corner cases. I know it is not the cleanest solution but it works.
An alternative fix, without touching the prototype, would be to see if the
version
property exists, react doesn't expose this but vue does, however that may break at any point in time, especially when Vue 3.0 is released