8000 fix: incorrect tab query in memory history by PeachScript · Pull Request #1829 · umijs/dumi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: incorrect tab query in memory history #1829

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

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

PeachScript
Copy link
Member

🤔 这个变动的性质是?/ What is the nature of this change?

  • 新特性提交 / New feature
  • bug 修复 / Fix bug
  • 样式优化 / Style optimization
  • 代码风格优化 / Code style optimization
  • 性能优化 / Performance optimization
  • 构建优化 / Build optimization
  • 网站、文档、Demo 改进 / Website, documentation, demo improvements
  • 重构代码或样式 / Refactor code or style
  • 测试相关 / Test related
  • 其他 / Other

🔗 相关 Issue / Related Issue

💡 需求背景和解决方案 / Background or solution

修复在 MemoryHistory 场景下,页面 Tab 切换后 query 更新不正确的问题,这会导致 useLocation 拿到的 search 值不正确,影响包含 TOC 链接地址在内的其他功能。

原因是 MemoryHistory 的 push 方法不会自动对 params 参数加上 ? 前缀,与 BrowserHistory 的行为不一致,复现链接:https://codesandbox.io/s/quirky-fast-xgvcyy?file=/src/App.js

解法是手动补上 ? 前缀确保无论在 MemoryHistory 还是 BrowserHistory 下都可以工作。

📝 更新日志 / Changelog

Language Changelog
🇺🇸 English Fix incorrect tab query in memory history
🇨🇳 Chinese 修复 memory history 下 tab query 参数不正确的问题

@vercel
Copy link
vercel bot commented Aug 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dumi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 10, 2023 5:22am

@PeachScript PeachScript merged commit f184c73 into master Aug 10, 2023
@PeachScript PeachScript deleted the hotfix/tab-query-memory-history branch August 10, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0