@@ -26,15 +26,15 @@ def link(*children: VdomChild, to: str, **attributes: Any) -> VdomDict:
2626 # properly sets the location. When a client-server communication layer is added to a \
2727 # future ReactPy release, this component will need to be rewritten to use that instead. \
2828 set_location = _use_route_state ().set_location
29- uuid = uuid4 ().hex
29+ class_uuid = f"link- { uuid4 ().hex } "
3030
3131 def on_click (_event : dict [str , Any ]) -> None :
3232 pathname , search = to .split ("?" , 1 ) if "?" in to else (to , "" )
3333 if search :
3434 search = f"?{ search } "
3535 set_location (Location (pathname , search ))
3636
37- class_name = uuid
37+ class_name = class_uuid
3838 if "className" in attributes :
3939 class_name = " " .join ([attributes .pop ("className" ), class_name ])
4040 # 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:
4545 ** attributes ,
4646 "href" : to ,
4747 "onClick" : on_click ,
48- "className" : uuid ,
48+ "className" : class_uuid ,
4949 }
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 )))
5151
5252
5353def route (path : str , element : Any | None , * routes : Route ) -> Route :
0 commit comments