@@ -141,31 +141,36 @@ def flush_sync_work(self, container) -> None:
141141 self ._flush_pending (container )
142142
143143 def update_container_sync (self , vnode , container ) -> None :
144+ previous_suppress = hooks_runtime ._suppress_immediate_passive_flush
145+ hooks_runtime ._suppress_immediate_passive_flush = True
144146 hooks_runtime ._reset_hook_state ()
145- self ._reconcile_children (container .root , [vnode ], "root" )
146- hooks_runtime ._finish_hook_state ()
147- container .current_vnode = vnode
148- container .render_state = None
149- container .force_rerender = False
150- container .root .force_rerender = False
151- first_child = container .root .childNodes [0 ] if container .root .childNodes else None
152- container ._last_deletions = list (getattr (first_child , "deletions" , [])) if first_child is not None else []
153- self ._root_fiber .child = SimpleNamespace (deletions = list (getattr (container , "_last_deletions" , [])))
154- self ._last_prepared_commit = SimpleNamespace (
155- commit_list = SimpleNamespace (effects = [1 ], layout_effects = [1 ]),
156- mutations = [1 ],
157- )
158- if callable (container .root .onComputeLayout ):
159- container .root .onComputeLayout ()
160- emitLayoutListeners (container .root )
161- self ._flush_class_lifecycle_queues ()
162- has_static = any (getattr (child , "internal_static" , False ) for child in container .root .childNodes )
163- if has_static and self ._commit_handlers ["on_immediate_commit" ]:
164- self ._commit_handlers ["on_immediate_commit" ]()
165- elif self ._commit_handlers ["on_commit" ]:
166- self ._commit_handlers ["on_commit" ]()
167- if self ._pending_errors :
168- raise self ._pending_errors .pop (0 )
147+ try :
148+ self ._reconcile_children (container .root , [vnode ], "root" )
149+ hooks_runtime ._finish_hook_state ()
150+ container .current_vnode = vnode
151+ container .render_state = None
152+ container .force_rerender = False
153+ container .root .force_rerender = False
154+ first_child = container .root .childNodes [0 ] if container .root .childNodes else None
155+ container ._last_deletions = list (getattr (first_child , "deletions" , [])) if first_child is not None else []
156+ self ._root_fiber .child = SimpleNamespace (deletions = list (getattr (container , "_last_deletions" , [])))
157+ self ._last_prepared_commit = SimpleNamespace (
158+ commit_list = SimpleNamespace (effects = [1 ], layout_effects = [1 ]),
159+ mutations = [1 ],
160+ )
161+ if callable (container .root .onComputeLayout ):
162+ container .root .onComputeLayout ()
163+ emitLayoutListeners (container .root )
164+ self ._flush_class_lifecycle_queues ()
165+ has_static = any (getattr (child , "internal_static" , False ) for child in container .root .childNodes )
166+ if has_static and self ._commit_handlers ["on_immediate_commit" ]:
167+ self ._commit_handlers ["on_immediate_commit" ]()
168+ elif self ._commit_handlers ["on_commit" ]:
169+ self ._commit_handlers ["on_commit" ]()
170+ if self ._pending_errors :
171+ raise self ._pending_errors .pop (0 )
172+ finally :
173+ hooks_runtime ._suppress_immediate_passive_flush = previous_suppress
169174
170175 def _render_component (self , vnode : RenderableNode , instance_id : str ):
171176 if vnode .type is react .Fragment :
0 commit comments