Skip to content

Commit

Permalink
fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea committed Jul 9, 2023
1 parent 688b717 commit c311345
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/py/reactpy/reactpy/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,8 @@ class LifeCycleHook:
# --- start render cycle ---
hook.affect_component_will_render(...)
hook.set_current()
component = ...
await hook.affect_component_will_render(component)
try:
# render the component
...
Expand All @@ -587,13 +585,11 @@ class LifeCycleHook:
current_hook().use_state(lambda: ...)
current_hook().add_effect(COMPONENT_DID_RENDER_EFFECT, lambda: ...)
finally:
hook.unset_current()
hook.affect_component_did_render()
await hook.affect_component_did_render()
# This should only be called after the full set of changes associated with a
# given render have been completed.
hook.affect_layout_did_render()
await hook.affect_layout_did_render()
# Typically an event occurs and a new render is scheduled, thus beginning
# the render cycle anew.
Expand Down

0 comments on commit c311345

Please sign in to comment.