Skip to content

Is it possible to implement full-fledged inheritance ? #1740

Answered by jamonholmgren
weedb asked this question in Q&A
Discussion options

You must be logged in to vote

Your English is excellent @weedb, no problem.

  1. You can redefine the prop. The only caveat is that TypeScript gets a little confused.

https://codesandbox.io/s/thirsty-surf-n7tde?file=/src/App.tsx

As you can see in the above CodeSandbox, I redefined the prop and assigned it a new type. TypeScript doesn't like it, but it works fine at runtime.

  1. No plans to implement regular inheritance. You can look at https://mobx-keystone.js.org/ as an alternative if this is super important to you.

Thanks!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@weedb
Comment options

@k-g-a
Comment options

@jamonholmgren
Comment options

Answer selected by jamonholmgren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants