Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion src/py/reactpy/reactpy/core/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

import inspect
from functools import wraps
from typing import Any, Callable, ParamSpec, TypeVar
from typing import Any, Callable, ParamSpec, TypeVar, overload

from reactpy.core.types import ComponentType, VdomDict

T = TypeVar("T", bound=ComponentType | VdomDict | str | None)
P = ParamSpec("P")


@overload
def component(function: None = None, *, priority: int) -> Callable[P, Component]: ...


def component(
function: Callable[P, T] | None = None,
*,
Expand Down
6 changes: 3 additions & 3 deletions src/py/reactpy/reactpy/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class ReconnectingOnly(list):


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


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


def use_state(
Expand Down Expand Up @@ -509,7 +509,7 @@ def empty(self) -> bool:
return False


def use_ref(initial_value: _Type, server_only: bool = True) -> Ref[_Type]:
def use_ref(initial_value: _Type, *, server_only: bool = True) -> Ref[_Type]:
"""See the full :ref:`Use State` docs for details

Parameters:
Expand Down