Skip to content

Commit

Permalink
Add debug log part 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbear committed Sep 12, 2024
1 parent 34adaef commit 142f863
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/yew-router/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn base_router(props: &RouterProps) -> Html {
console_dbg!("render");
// Can't use `use_Effect_with` since need to track old and new, not just new.
use_effect(move || {
console_dbg!("{basename:?} {:?}", *old_basename);
console_dbg!(format!("{basename:?} {:?}", *old_basename));
if basename != *old_basename {
// If `old_basename` is `Some`, path is probably prefixed with `old_basename`.
// If `old_basename` is `None`, path may or may not be prefixed with the new `basename`,
Expand All @@ -99,7 +99,7 @@ fn base_router(props: &RouterProps) -> Html {
let location = history.location();
let stripped = old_navigator.strip_basename(Cow::from(location.path()));
let prefixed = navigator.prefix_basename(&stripped);
console_dbg!("s {stripped} {prefixed}");
console_dbg!(format!("s {stripped} {prefixed}"));
if prefixed != location.path() {
history
.replace_with_query(prefixed, Raw(location.query_str()))
Expand Down

0 comments on commit 142f863

Please sign in to comment.