33var React = require ( "react" ) ;
44var Fragment = React . Fragment || "div" ;
55
6+ function setStateThen ( instance ) {
7+ return function ( update , then ) {
8+ return instance . setState ( update , function ( ) {
9+ then ( this . state ) ;
10+ } ) ;
11+ } ;
12+ }
13+
614exports . component_ = function ( spec ) {
715 var Component = function constructor ( ) {
816 this . state = spec . initialState ;
@@ -20,7 +28,7 @@ exports.component_ = function(spec) {
2028 props : this . props ,
2129 state : this . state ,
2230 setState : this . _setState ,
23- setStateThen : this . _setState ,
31+ setStateThen : setStateThen ( this ) ,
2432 instance_ : this
2533 } ) ;
2634 } ;
@@ -31,7 +39,7 @@ exports.component_ = function(spec) {
3139 props : this . props ,
3240 state : this . state ,
3341 setState : this . _setState ,
34- setStateThen : this . _setState ,
42+ setStateThen : setStateThen ( this ) ,
3543 instance_ : this
3644 } ) ;
3745 } ;
@@ -41,7 +49,7 @@ exports.component_ = function(spec) {
4149 props : this . props ,
4250 state : this . state ,
4351 setState : this . _setState ,
44- setStateThen : this . _setState ,
52+ setStateThen : setStateThen ( this ) ,
4553 instance_ : this
4654 } ) ;
4755 } ;
0 commit comments