11
11
from fnmatch import fnmatch
12
12
from importlib import import_module
13
13
from pathlib import Path
14
- from typing import Any , Callable , Sequence
14
+ from typing import Any , Callable , Mapping , Sequence
15
15
from uuid import UUID , uuid4
16
16
17
17
import jsonpointer
@@ -407,7 +407,11 @@ def strtobool(val):
407
407
408
408
409
409
def prerender_component (
410
- user_component : ComponentConstructor , args , kwargs , uuid , request : HttpRequest
410
+ user_component : ComponentConstructor ,
411
+ args : Sequence ,
412
+ kwargs : Mapping ,
413
+ uuid : str | UUID ,
414
+ request : HttpRequest ,
411
415
) -> str :
412
416
"""Prerenders a ReactPy component and returns the HTML string."""
413
417
search = request .GET .urlencode ()
@@ -432,12 +436,12 @@ def prerender_component(
432
436
433
437
434
438
def vdom_or_component_to_string (
435
- vdom_or_component : Any , request : HttpRequest | None = None , uuid : UUID | None = None
439
+ vdom_or_component : Any , request : HttpRequest | None = None , uuid : str | None = None
436
440
) -> str :
437
441
"""Converts a VdomDict or component to an HTML string. If a string is provided instead, it will be
438
442
automatically returned."""
439
443
if isinstance (vdom_or_component , dict ):
440
- return vdom_to_html (vdom_or_component )
444
+ return vdom_to_html (vdom_or_component ) # type: ignore
441
445
442
446
if hasattr (vdom_or_component , "render" ):
443
447
if not request :
0 commit comments