File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 77
88from reactpy_django .html import pyscript
99from 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
1111
1212
1313@component
@@ -19,7 +19,7 @@ def _pyscript_component(
1919 rendered , set_rendered = hooks .use_state (False )
2020 uuid_ref = hooks .use_ref (uuid4 ().hex .replace ("-" , "" ))
2121 uuid = uuid_ref .current
22- initial = vdom_or_component_to_string (initial , uuid = uuid )
22+ initial = reactpy_to_string (initial , uuid = uuid )
2323 executor = render_pyscript_template (file_paths , uuid , root )
2424
2525 if not rendered :
Original file line number Diff line number Diff line change 1818from reactpy_django .pyscript .utils import PYSCRIPT_LAYOUT_HANDLER , extend_pyscript_config , render_pyscript_template
1919from reactpy_django .utils import (
2020 prerender_component ,
21+ reactpy_to_string ,
2122 save_component_params ,
2223 strtobool ,
2324 validate_component_args ,
2425 validate_host ,
25- vdom_or_component_to_string ,
2626)
2727
2828if TYPE_CHECKING :
@@ -203,7 +203,7 @@ def pyscript_component(
203203
204204 uuid = uuid4 ().hex
205205 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 )
207207 executor = render_pyscript_template (file_paths , uuid , root )
208208
209209 return {
Original file line number Diff line number Diff line change @@ -410,9 +410,7 @@ def prerender_component(
410410 return vdom_to_html (vdom_tree ) # type: ignore
411411
412412
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 :
416414 """Converts a VdomDict or component to an HTML string. If a string is provided instead, it will be
417415 automatically returned."""
418416 if isinstance (vdom_or_component , dict ):
You can’t perform that action at this time.
0 commit comments