wip: debugging

This commit is contained in:
Jonathan Kelley committed 2022-01-30 14:08:03 -05:00
1 parent 875977f5a6
commit 3edf3e367f
11 files changed
+367 -128

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ pub struct LinkProps<'a> {
}
pub fn Link<'a>(cx: Scope<'a, LinkProps<'a>>) -> Element {
log::trace!("render Link to {}", cx.props.to);
// log::trace!("render Link to {}", cx.props.to);
if let Some(service) = cx.consume_context::<RouterService>() {
return cx.render(rsx! {
a {
+2 -2
View File
@@ -30,7 +30,7 @@ pub fn Route<'a>(cx: Scope<'a, RouteProps<'a>>) -> Element {
Some(ctx) => ctx.total_route.to_string(),
None => cx.props.to.to_string(),
};
log::trace!("total route for {} is {}", cx.props.to, total_route);
// log::trace!("total route for {} is {}", cx.props.to, total_route);
// provide our route context
let route_context = cx.provide_context(RouteContext {
@@ -48,7 +48,7 @@ pub fn Route<'a>(cx: Scope<'a, RouteProps<'a>>) -> Element {
Some(RouteInner {})
});
log::trace!("Checking route {}", cx.props.to);
// log::trace!("Checking route {}", cx.props.to);
if router_root.should_render(cx.scope_id()) {
cx.render(rsx!(&cx.props.children))
+1
View File
@@ -17,6 +17,7 @@ pub struct RouterProps<'a> {
#[allow(non_snake_case)]
pub fn Router<'a>(cx: Scope<'a, RouterProps<'a>>) -> Element {
log::debug!("running router {:?}", cx.scope_id());
let svc = cx.use_hook(|_| {
let update = cx.schedule_update_any();
cx.provide_context(RouterService::new(update, cx.scope_id()))