Skip to content

Add setup function, to wrap componentDidMount #10

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

Merged
merged 11 commits into from
Feb 21, 2018
Prev Previous commit
Next Next commit
Bind this_
  • Loading branch information
paf31 committed Feb 15, 2018
commit 2806dfba88f6788eab668586978c9dd890ef4299
1 change: 1 addition & 0 deletions src/React/Basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports.react_ = function(spec) {
return spec.initialState(this.props);
},
componentDidMount: function() {
var this_ = this;
spec.setup(this.props, this.state, function(newState) {
return function() {
this_.setState(newState);
Expand Down