File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
code/core/src/component-testing/components Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -253,12 +253,18 @@ export const Panel = memo<{ refId?: string; storyId: string; storyUrl: string }>
253253 ) ;
254254 } ,
255255 [ STORY_RENDER_PHASE_CHANGED ] : ( event ) => {
256+ if ( event . newPhase === 'preparing' || event . newPhase === 'loading' ) {
257+ // A render cycle may not actually make it to the rendering phase.
258+ // We don't want to update any state until it does.
259+ return ;
260+ }
261+
256262 lastRenderId . current = Math . max ( lastRenderId . current , event . renderId || 0 ) ;
257263 if ( lastRenderId . current !== event . renderId ) {
258264 return ;
259265 }
260266
261- if ( event . newPhase === 'preparing ' ) {
267+ if ( event . newPhase === 'rendering ' ) {
262268 log . current = [ getInternalRenderLogItem ( CallStates . ACTIVE ) ] ;
263269 calls . current . set ( INTERNAL_RENDER_CALL_ID , getInternalRenderCall ( storyId ) ) ;
264270 set ( {
You can’t perform that action at this time.
0 commit comments