Effect CommunityEC
Effect Community5mo ago
1 reply
ElPibe

Can you override fields in extended class Schema?

Suppose we have Class A:
class A extends Schema.Class<A>("A")({
  parentField: Schema.enums(EnumA)
}){}

And we want to extend Class B from A, but we want to override parentField
class B extends A.extend<B>("B")({
    parentField: Schema.enums(EnumB)
}){}

Like this doesn't work, but i wonder if there is any way to achieve this

Edit: I found if you make parent field optional, it doesnt error but props become void
Was this page helpful?