We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've been experiencing a weird issue when using react-async in conjunction with react-router-component in my isomorphic app.
Given the following mixin:
... MyMixin = { foo: function() { console.log("hello!"); } } ...
and the React class:
... var MyView = React.createClass({ mixins: [Async.Mixin, MyMixin], getInitialStateAsync: function(cb) { this.foo(); // only works in the browser ... } ... });
When mounting, the browser will throw an error saying this.foo() is undefined. The workaround is to do something like (courtesy of @theadam):
this.foo()
... var MyView = React.createClass({ mixins: [Async.Mixin, MyMixin], getInitialStateAsync: function(cb) { var component = this.type && this.type.prototype ? this.type.prototype : this; component.foo(); // Works now ... } });
Obviously, the fix is less than ideal when using it in a larger app. Am I doing something wrong or is this an oversight?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've been experiencing a weird issue when using react-async in conjunction with react-router-component in my isomorphic app.
Given the following mixin:
and the React class:
When mounting, the browser will throw an error saying
this.foo()
is undefined. The workaround is to do something like (courtesy of @theadam):Obviously, the fix is less than ideal when using it in a larger app. Am I doing something wrong or is this an oversight?
The text was updated successfully, but these errors were encountered: