Skip to content

Commit 63985c1

Browse files
committed
fix types
1 parent bbf6d5a commit 63985c1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/idom/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ def vdom_to_html(value: str | VdomDict, indent: int = 0, depth: int = 0) -> str:
110110
if "children" in value:
111111
children_list: list[str] = []
112112

113-
child: VdomDict | str
114113
for child in value["children"]:
115114
if isinstance(child, (dict, str)):
116-
children_list.append(vdom_to_html(child, indent, depth + 1))
115+
children_list.append(
116+
vdom_to_html(cast("VdomDict | str", child), indent, depth + 1)
117+
)
117118
else:
118119
warn(
119120
f"Could not convert element of type {type(child).__name__!r} to HTML - {child}",

src/idom/widgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,5 @@ def swap(constructor: Callable[[], Any] | None) -> None:
187187

188188

189189
def _use_callable(initial_func: _Func) -> Tuple[_Func, Callable[[_Func], None]]:
190-
state = hooks.use_state(lambda: initial_func)
191-
return state[0], lambda new: state[1](lambda old: new)
190+
state, set_state = hooks.use_state(lambda: initial_func)
191+
return state, lambda new: set_state(lambda old: new)

0 commit comments

Comments
 (0)