-
Notifications
You must be signed in to change notification settings - Fork 50k
Closed
Description
I want to use ES5 style getters inside of a mixin. It blows up when it comes to this line inside of ReactClass where by it invokes my getter method while it's mixing it in. This has some unexpected behavior.
https://github.com/facebook/react/blob/master/src/isomorphic/classic/class/ReactClass.js#L485
const fooMixin = {
componentWillMount() {
this.myFoo = 'bar';
}
get foo() {
return this.myFoo;
}
}
const MyComponent = React.createClass({
mixins: [fooMixin],
render() {
return <span>{this.foo}</span>
}
});Metadata
Metadata
Assignees
Labels
No labels