-
Notifications
You must be signed in to change notification settings - Fork 139
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
Issues with inheritance using babel and ES6 classes #327
Comments
It's okay that Validation doesn't work because according to JSON-schema, you need So in your JSFiddle, if you add schema: {
type: 'object',
properties: {...}
} |
That means all static properties are inherited from parent class which has
|
That makes sense. |
Fixed in 3.0.0-beta.5 |
Thanks a lot! |
Description:
I'm trying to use custom
recordClass
inside mapper. For doing this I extendJSData.Record
in order to have all the niceties of schema validation. But validation doesn't work.Example: https://jsfiddle.net/wyumc5ao/2/
Where is the issue?:
The issue is in
__super__
accessor which is defined byextend
function. This property is inherited by child class (i.e.,Task
in the example) fromRecord
class. Babel doesn't set__super__
property on the constructor and thenutils.getSuper(...) === Record
fails becauseutils.getSuper
returnsComponent
and notRecord
as it should.Possible fix:
Add additional check for `hasOwnProperty('super'). Something like this:
Conclusion:
If you are ok with the fix I'll send pull-request on Sunday
The text was updated successfully, but these errors were encountered: