Open Amareis opened 3 years ago
I think it is this babel decorator plugin bug: https://github.com/babel/babel/issues/11131
Also related: https://github.com/xaviergonz/mobx-keystone/issues/122
Yep, definitely it's babel bug. Currently i use external method and assign it into static property
static foo = foo
Can we fix this babel bug? I'll try to look into this.
If you were to fix the babel plugin that'd be awesome :) Not much that can be done on the mobx-keystone repo sadly
Uh-oh, so I fixed plugin, but not pushed it yet.
That's awesome! Let's hope it gets merged soon 👍
Workarounds in that issue aren't very appealing. I think we'll just avoid static methods for now.
womp womp - is this still an issue?
It never got fixed by babel, so yes. I don't know if it happens with the new (non legacy) decorators though.
https://codesandbox.io/s/mobx-keystone-static-method-problem-4thb2?file=/src/index.tsx
I think it's coupled with babel, because I cannot reproduce it in pure ts tests. Possible related #18 #92