Skip to content

Commit 6aeaef6

Browse files
committed
improve variable name clarity for path in navigate component
1 parent 4658004 commit 6aeaef6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/reactpy_router/components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ def navigate(to: str, replace: bool = False, key: Key | None = None) -> Componen
107107
def _navigate(to: str, replace: bool = False) -> VdomDict | None:
108108
location = use_connection().location
109109
set_location = _use_route_state().set_location
110-
pathname = to.split("?", 1)[0]
110+
new_path = to.split("?", 1)[0]
111111

112112
def on_navigate_callback(_event: dict[str, Any]) -> None:
113113
set_location(Location(**_event))
114114

115-
if location.path != pathname:
115+
if location.path != new_path:
116116
return Navigate({"onNavigateCallback": on_navigate_callback, "to": to, "replace": replace})
117117

118118
return None

0 commit comments

Comments
 (0)