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

Function use_ref

src/py/reactpy/reactpy/core/hooks.py:474–483  ·  view source on GitHub ↗

See the full :ref:`Use State` docs for details Parameters: initial_value: The value initially assigned to the reference. Returns: A :class:`Ref` object.

(initial_value: _Type)

Source from the content-addressed store, hash-verified

472
473
474def use_ref(initial_value: _Type) -> Ref[_Type]:
475 """See the full :ref:`Use State` docs for details
476
477 Parameters:
478 initial_value: The value initially assigned to the reference.
479
480 Returns:
481 A :class:`Ref` object.
482 """
483 return _use_const(lambda: Ref(initial_value))
484
485
486def _use_const(function: Callable[[], _Type]) -> _Type:

Callers 1

use_effectFunction · 0.85

Calls 2

RefClass · 0.90
_use_constFunction · 0.85

Tested by

no test coverage detected