Skip to content

Commit c311345

Browse files
committed
fix doctest
1 parent 688b717 commit c311345

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Diff for: src/py/reactpy/reactpy/core/hooks.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,8 @@ class LifeCycleHook:
572572
573573
# --- start render cycle ---
574574
575-
hook.affect_component_will_render(...)
576-
577-
hook.set_current()
578-
575+
component = ...
576+
await hook.affect_component_will_render(component)
579577
try:
580578
# render the component
581579
...
@@ -587,13 +585,11 @@ class LifeCycleHook:
587585
current_hook().use_state(lambda: ...)
588586
current_hook().add_effect(COMPONENT_DID_RENDER_EFFECT, lambda: ...)
589587
finally:
590-
hook.unset_current()
591-
592-
hook.affect_component_did_render()
588+
await hook.affect_component_did_render()
593589
594590
# This should only be called after the full set of changes associated with a
595591
# given render have been completed.
596-
hook.affect_layout_did_render()
592+
await hook.affect_layout_did_render()
597593
598594
# Typically an event occurs and a new render is scheduled, thus beginning
599595
# the render cycle anew.

0 commit comments

Comments
 (0)