Skip to content

Commit 8559c7b

Browse files
committed
move effect start to back to layout render
1 parent fc8e688 commit 8559c7b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/py/reactpy/reactpy/core/_life_cycle_hook.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,18 @@ async def affect_component_will_render(self, component: ComponentType) -> None:
202202

203203
async def affect_component_did_render(self) -> None:
204204
"""The component completed a render"""
205-
stop = Event()
206-
self._effect_stops.append(stop)
207-
self._effect_tasks.extend(create_task(e(stop)) for e in self._effect_funcs)
208-
self._effect_funcs.clear()
205+
self.unset_current()
209206
self._rendered_atleast_once = True
210207
self._current_state_index = 0
211208
self._render_access.release()
212209
del self.component
213-
self.unset_current()
214210

215211
async def affect_layout_did_render(self) -> None:
216212
"""The layout completed a render"""
217-
pass
213+
stop = Event()
214+
self._effect_stops.append(stop)
215+
self._effect_tasks.extend(create_task(e(stop)) for e in self._effect_funcs)
216+
self._effect_funcs.clear()
218217

219218
async def affect_component_will_unmount(self) -> None:
220219
"""The component is about to be removed from the layout"""

0 commit comments

Comments
 (0)