Skip to content

Commit

Permalink
Dont @overload for the function definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ntjess committed Jul 12, 2024
1 parent d7d864e commit 429ca6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions solara/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ def component(obj: FuncT, mime_bundle: Dict[str, Any] = ...) -> FuncT: ...
def component(obj: Callable[P, None], mime_bundle: Dict[str, Any] = ...) -> Callable[P, reacton.core.Element]: ...


@overload
def component(obj: Union[Callable[P, None], FuncT, None] = None, mime_bundle: Dict[str, Any] = reacton.core.mime_bundle_default) -> Union[Callable[[FuncT], FuncT], FuncT, Callable[P, reacton.core.Element]]:
def component(
obj: Union[Callable[P, None], FuncT, None] = None, mime_bundle: Dict[str, Any] = reacton.core.mime_bundle_default
) -> Union[Callable[[FuncT], FuncT], FuncT, Callable[P, reacton.core.Element]]:
def wrapper(obj: Union[Callable[P, None], FuncT]) -> FuncT:
validate_hooks.HookValidator(obj).run()
return reacton.component(obj, mime_bundle) # type: ignore
Expand Down

0 comments on commit 429ca6b

Please sign in to comment.