chore: add some fixes to hot reload
This commit is contained in:
1 parent
079d71fb2b
commit
366e46eddf
4 files changed
+34
-19
No files matched your search
@@ -55,6 +55,9 @@ pub struct LinkProps<'a> {
|
||||
|
||||
/// Pass children into the `<a>` element
|
||||
pub children: Element<'a>,
|
||||
|
||||
/// The onclick event handler.
|
||||
pub onclick: Option<EventHandler<'a, MouseEvent>>,
|
||||
}
|
||||
|
||||
/// A component that renders a link to a route.
|
||||
@@ -119,7 +122,7 @@ pub fn Link<'a>(cx: Scope<'a, LinkProps<'a>>) -> Element {
|
||||
title: format_args!("{}", title.unwrap_or("")),
|
||||
prevent_default: "{prevent_default}",
|
||||
target: format_args!("{}", if * new_tab { "_blank" } else { "" }),
|
||||
onclick: move |_| {
|
||||
onclick: move |evt| {
|
||||
log::trace!("Clicked link to {}", to);
|
||||
|
||||
if !outerlink {
|
||||
@@ -138,6 +141,10 @@ pub fn Link<'a>(cx: Scope<'a, LinkProps<'a>>) -> Element {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(onclick) = cx.props.onclick.as_ref() {
|
||||
onclick.call(evt);
|
||||
}
|
||||
},
|
||||
children
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user