File tree 3 files changed +5
-7
lines changed
3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 7
7
8
8
from reactpy_django .html import pyscript
9
9
from reactpy_django .pyscript .utils import render_pyscript_template
10
- from reactpy_django .utils import vdom_or_component_to_string
10
+ from reactpy_django .utils import reactpy_to_string
11
11
12
12
13
13
@component
@@ -19,7 +19,7 @@ def _pyscript_component(
19
19
rendered , set_rendered = hooks .use_state (False )
20
20
uuid_ref = hooks .use_ref (uuid4 ().hex .replace ("-" , "" ))
21
21
uuid = uuid_ref .current
22
- initial = vdom_or_component_to_string (initial , uuid = uuid )
22
+ initial = reactpy_to_string (initial , uuid = uuid )
23
23
executor = render_pyscript_template (file_paths , uuid , root )
24
24
25
25
if not rendered :
Original file line number Diff line number Diff line change 18
18
from reactpy_django .pyscript .utils import PYSCRIPT_LAYOUT_HANDLER , extend_pyscript_config , render_pyscript_template
19
19
from reactpy_django .utils import (
20
20
prerender_component ,
21
+ reactpy_to_string ,
21
22
save_component_params ,
22
23
strtobool ,
23
24
validate_component_args ,
24
25
validate_host ,
25
- vdom_or_component_to_string ,
26
26
)
27
27
28
28
if TYPE_CHECKING :
@@ -203,7 +203,7 @@ def pyscript_component(
203
203
204
204
uuid = uuid4 ().hex
205
205
request : HttpRequest | None = context .get ("request" )
206
- initial = vdom_or_component_to_string (initial , request = request , uuid = uuid )
206
+ initial = reactpy_to_string (initial , request = request , uuid = uuid )
207
207
executor = render_pyscript_template (file_paths , uuid , root )
208
208
209
209
return {
Original file line number Diff line number Diff line change @@ -410,9 +410,7 @@ def prerender_component(
410
410
return vdom_to_html (vdom_tree ) # type: ignore
411
411
412
412
413
- def vdom_or_component_to_string (
414
- vdom_or_component : Any , request : HttpRequest | None = None , uuid : str | None = None
415
- ) -> str :
413
+ def reactpy_to_string (vdom_or_component : Any , request : HttpRequest | None = None , uuid : str | None = None ) -> str :
416
414
"""Converts a VdomDict or component to an HTML string. If a string is provided instead, it will be
417
415
automatically returned."""
418
416
if isinstance (vdom_or_component , dict ):
You can’t perform that action at this time.
0 commit comments