-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: intro routes prop config keepQuery
#12228
feat: intro routes prop config keepQuery
#12228
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe recent updates focus on enhancing the routing behavior, specifically addressing the issue of query parameters being lost during redirection. The changes include improved handling of query parameters in Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- docs/docs/docs/guides/routes.md (1 hunks)
- packages/renderer-react/src/routes.tsx (2 hunks)
Additional comments: 2
packages/renderer-react/src/routes.tsx (1)
- 57-66: The implementation of
NavigateWithParams
correctly appends query parameters to the destination URL whenkeepQuery
is set totrue
. This aligns with the PR's objective to preserve URL parameters during redirects. However, consider handling edge cases where the original URL might already contain query parameters that conflict with the ones being preserved.Ensure that potential conflicts between existing and preserved query parameters are handled gracefully, possibly by merging them or giving precedence to one set over the other.
docs/docs/docs/guides/routes.md (1)
- 124-134: The documentation effectively explains the default behavior of redirects and how to use the
keepQuery
option to retain original query parameters. This addition will be valuable for developers looking to maintain query parameters across redirects.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12228 +/- ##
==========================================
- Coverage 28.41% 28.40% -0.02%
==========================================
Files 492 492
Lines 15166 15172 +6
Branches 3626 3627 +1
==========================================
Hits 4310 4310
- Misses 10084 10089 +5
- Partials 772 773 +1 ☔ View full report in Codecov by Sentry. |
keepSearch |
keepURLSearchParams |
看起来更新到最新版本,问题还是有啊 |
如有问题,需要给一个最小复现。 |
close #10606
从去年开始反馈较多希望增加的功能:路由表配置 redirect 跳转时,希望能携带参数,故新增一个
keepQuery
选项用来在跳转时保持原 url 参数。欢迎提出更好的命名意见。
命名的想法:
keepQuery
/withQuery
/keepURLQuery
。Summary by CodeRabbit