-
-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(react-router): take from
into account when navigating with params
or layouts
#1721
Conversation
…ckout - routesByPath doesn't include branches, they are deduped with index routes therefor I am using flatRoutes - preload redirects should not include from automatically as it should be explicit - declarative route masking should be pass from because from for route masking does not assert a location
☁️ Nx Cloud ReportCI is running/has finished running commands for commit a982e76. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targetsSent with 💌 from NxCloud. |
from
into acount for routes with params
and layoutsfrom
into account when navigating with params
or layouts
packages/react-router/src/router.ts
Outdated
@@ -1773,8 +1786,7 @@ export class Router< | |||
preload: !!preload, | |||
context: parentContext, | |||
location, | |||
navigate: (opts: any) => | |||
this.navigate({ ...opts, from: match.pathname }), | |||
navigate: (opts: any) => this.navigate({ ...opts }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could avoid the spread here yea?
navigate: (opts: any) => this.navigate(opts as any)
from
into account when navigating with params
or layoutsfrom
into account when navigating with params
or layouts
…ion for preloading and beforeLoad
from
redirect preloads. Users should specify this manuallyfrom
in declarative route masks when building the location