Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/py/reactpy/reactpy/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ class ReconnectingOnly(list):


@overload
def use_state(initial_value: Callable[[], _Type], *, server_only: bool = False) -> State[_Type]: ...
def use_state(
initial_value: Callable[[], _Type], *, server_only: bool = False
) -> State[_Type]: ...


@overload
Expand Down Expand Up @@ -190,12 +192,9 @@ def use_effect(
hook = get_current_hook()
if hook.reconnecting.current:
if not isinstance(dependencies, ReconnectingOnly):
return
dependencies = None
else:
if isinstance(dependencies, ReconnectingOnly):
return
dependencies = _try_to_infer_closure_values(function, dependencies)
return memoize(lambda: None)
elif isinstance(dependencies, ReconnectingOnly):
return

def add_effect(function: _EffectApplyFunc) -> None:
if not asyncio.iscoroutinefunction(function):
Expand Down