@@ -106,7 +106,7 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
106106 value : undefined ,
107107 compute : ( ) => this . render ( false ) ,
108108 sources : new Set < Atom > ( ) ,
109- state : ComputationState . STALE ,
109+ state : ComputationState . EXECUTED ,
110110 } ;
111111 const defaultProps = C . defaultProps ;
112112 props = Object . assign ( { } , props ) ;
@@ -138,10 +138,11 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
138138 }
139139 const component = this . component ;
140140 try {
141- const previousComputation = getCurrentComputation ( ) ;
142- setComputation ( undefined ) ;
143- await Promise . all ( this . willStart . map ( ( f ) => withoutReactivity ( ( ) => f . call ( component ) ) ) ) ;
144- setComputation ( previousComputation ) ;
141+ let prom : Promise < any [ ] > ;
142+ withoutReactivity ( ( ) => {
143+ prom = Promise . all ( this . willStart . map ( ( f ) => f . call ( component ) ) ) ;
144+ } ) ;
145+ await prom ! ;
145146 } catch ( e ) {
146147 this . app . handleError ( { node : this , error : e } ) ;
147148 return ;
@@ -256,11 +257,11 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
256257 applyDefaultProps ( props , defaultProps ) ;
257258 }
258259
259- const previouwsComputation = getCurrentComputation ( ) ;
260- setComputation ( undefined ) ;
261- await Promise . all ( this . willUpdateProps . map ( ( f ) => f . call ( component , props ) ) ) ;
262- setComputation ( previouwsComputation ) ;
263-
260+ let prom : Promise < any [ ] > ;
261+ withoutReactivity ( ( ) => {
262+ prom = Promise . all ( this . willUpdateProps . map ( ( f ) => f . call ( component , props ) ) ) ;
263+ } ) ;
264+ await prom ! ;
264265 if ( fiber !== this . fiber ) {
265266 return ;
266267 }
0 commit comments