@@ -74,7 +74,7 @@ def router_component(
7474 History ( # type: ignore
7575 {"on_change" : lambda event : set_location (Location (** event ))}
7676 ),
77- route_elements ,
77+ html . _ ( route_elements ) ,
7878 value = Connection (old_conn .scope , location , old_conn .carrier ),
7979 )
8080
@@ -92,16 +92,14 @@ def link(*children: VdomChild, to: str, **attributes: Any) -> VdomDict:
9292 "onClick" : lambda event : set_location (Location (** event )),
9393 "id" : uuid ,
9494 }
95- return html ._ (
96- html .a (attrs , * children ), html .script (link_js_content .replace ("UUID" , uuid ))
97- )
95+ return html ._ (html .a (attrs , * children ), html .script (link_js_content .replace ("UUID" , uuid )))
9896
9997
10098def use_params () -> dict [str , Any ]:
10199 """The `use_params` hook returns an object of key/value pairs of the dynamic params \
102100 from the current URL that were matched by the `Route`. Child routes inherit all params \
103101 from their parent routes.
104-
102+
105103 For example, if you have a `URL_PARAM` defined in the route `/example/<URL_PARAM>/`,
106104 this hook will return the URL_PARAM value that was matched."""
107105
@@ -163,14 +161,10 @@ def _match_route(
163161
164162
165163History = export (
166- module_from_file (
167- "reactpy-router" , file = Path (__file__ ).parent / "static" / "bundle.js"
168- ),
164+ module_from_file ("reactpy-router" , file = Path (__file__ ).parent / "static" / "bundle.js" ),
169165 ("History" ),
170166)
171- link_js_content = (Path (__file__ ).parent / "static" / "link.js" ).read_text (
172- encoding = "utf-8"
173- )
167+ link_js_content = (Path (__file__ ).parent / "static" / "link.js" ).read_text (encoding = "utf-8" )
174168
175169
176170@dataclass
0 commit comments