Skip to content
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

types.compose is useful, but cant overwrite #209

Closed
homura opened this issue Jun 26, 2017 · 1 comment
Closed

types.compose is useful, but cant overwrite #209

homura opened this issue Jun 26, 2017 · 1 comment

Comments

@homura
Copy link
Contributor

homura commented Jun 26, 2017

I was trying to overwrite something like this

const Parent = types.model({
  name: '',
  alias: '',
  get displayName() { return this.alias || this.name; }
})

const child = types.compose(Parent, {
  type: '',
  get displayName() { return this.alias || this.name + type; }
})
Cannot redefine property: displayName

I has changed mobx-state-tree(0.8.2) source to

descriptor.configurable = true; // line of 100

and it works

How can i resolve this error? Or configurable will be true in next version?

Sorry for my poor English.

@mweststrate
Copy link
Member

mweststrate commented Jun 26, 2017 via email

mweststrate added a commit that referenced this issue Jun 26, 2017
make types.compose can be overwrite #209
@homura homura closed this as completed Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants