MCPcopy Index your code
hub / github.com/reactive-python/reactpy / current_hook

Function current_hook

src/py/reactpy/reactpy/core/_life_cycle_hook.py:24–30  ·  view source on GitHub ↗

Get the current :class:`LifeCycleHook`

()

Source from the content-addressed store, hash-verified

22
23
24def current_hook() -> LifeCycleHook:
25 """Get the current :class:`LifeCycleHook`"""
26 hook_stack = _HOOK_STATE.get()
27 if not hook_stack:
28 msg = "No life cycle hook is active. Are you rendering in a layout?"
29 raise RuntimeError(msg)
30 return hook_stack[-1]
31
32
33class LifeCycleHook:

Callers 8

__init__Method · 0.90
use_effectFunction · 0.90
use_debug_valueFunction · 0.90
use_contextFunction · 0.90
renderMethod · 0.90
_use_constFunction · 0.90
wrapperMethod · 0.90
use_force_renderFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected