mobxjs / mobx-vue

🐉 Vue bindings for MobX
MIT License
475 stars 22 forks source link

meta component #10

Closed xrado closed 6 years ago

xrado commented 6 years ago

I have a case where I pass component definition directly to vue meta component.

<component :is="{..component definition}" v-bind="props"/>

wrapping it with observer breaks a whole thing. Do you have any idea what to do here?

xrado commented 6 years ago

@kuitos I found the issue if the component has data property with the value null then it breaks on

vue.esm.js?a3f3:1741 TypeError: Cannot read property '$mobx' of null
    at eval (collectData.js?eaa5:15)

see example https://codesandbox.io/s/xl42xljxrp click on button "2"

kuitos commented 6 years ago

@xrado observer always returned the extended component constructor, for issue 1 could you provide a codesandbox link?

For issue 2 I will fix it and release soon.

Thanks for your feedback!

kuitos commented 6 years ago

@xrado issue 2 fixed and released v2.0.5!

xrado commented 6 years ago

@kuitos this also solves the first issue ...awesome, thanks