@@ -26,15 +26,15 @@ def link(*children: VdomChild, to: str, **attributes: Any) -> VdomDict:
26
26
# properly sets the location. When a client-server communication layer is added to a \
27
27
# future ReactPy release, this component will need to be rewritten to use that instead. \
28
28
set_location = _use_route_state ().set_location
29
- uuid = uuid4 ().hex
29
+ class_uuid = f"link- { uuid4 ().hex } "
30
30
31
31
def on_click (_event : dict [str , Any ]) -> None :
32
32
pathname , search = to .split ("?" , 1 ) if "?" in to else (to , "" )
33
33
if search :
34
34
search = f"?{ search } "
35
35
set_location (Location (pathname , search ))
36
36
37
- class_name = uuid
37
+ class_name = class_uuid
38
38
if "className" in attributes :
39
39
class_name = " " .join ([attributes .pop ("className" ), class_name ])
40
40
# TODO: This can be removed when ReactPy stops supporting underscores in attribute names
@@ -45,9 +45,9 @@ def on_click(_event: dict[str, Any]) -> None:
45
45
** attributes ,
46
46
"href" : to ,
47
47
"onClick" : on_click ,
48
- "className" : uuid ,
48
+ "className" : class_uuid ,
49
49
}
50
- return html ._ (html .a (attrs , * children ), html .script (link_js_content .replace ("UUID" , uuid )))
50
+ return html ._ (html .a (attrs , * children ), html .script (link_js_content .replace ("UUID" , class_uuid )))
51
51
52
52
53
53
def route (path : str , element : Any | None , * routes : Route ) -> Route :
0 commit comments