-
Notifications
You must be signed in to change notification settings - Fork 433
Reactivity and undefined properties #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Unfortunately, we can't since the Babel decorator treats an uninitialized property and a property initialized with I'll revisit with this behavior after Babel and TypeScript implement stage 2 or later decorators. |
Hi @ktsn, it seems that it landed long time ago in babel/babel#7976 Apparently, the changelog mentioned only this:
But it has been there since nearly 2 years now. |
Because TypeScript does not support stage 2 yet. |
In #35, a change was made where properties that are
undefined
will not become reactive. I feel like this change was overshooting its intentions a little, since the point is actually to get rid of uninitialized properties in the data object.Considering that in a lot of coding standards the use of
null
is prohibited in favour of usingundefined
, it's a little problematic thatnull
has to be used as a default value in class components.I'm not sure whether there's a better way to fix this for Babel users, but as a TypeScript user, this change has honestly become quite inconvenient as every class component now needs to be littered with warning suppressions for the
null
keyword.Any chance a better solution could be looked into here?
The text was updated successfully, but these errors were encountered: