Skip to content

feat: Add React 19 support to @ahooksjs/use-url-state - #2921

Closed
crazylxr with Copilot wants to merge 1 commit into
masterfrom
copilot/add-react-19-support
Closed

feat: Add React 19 support to @ahooksjs/use-url-state#2921
crazylxr with Copilot wants to merge 1 commit into
masterfrom
copilot/add-react-19-support

Conversation

Copilot AI commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

@ahooksjs/use-url-statepeerDependencies 未声明 React 19 支持,与主 ahooks 包不一致。同时补充了 react-router v7 的支持声明。

[English Template / 英文模板]

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

use-url-state react 19 support

💡 需求背景和解决方案

ahooks 已声明支持 React 19,但 @ahooksjs/use-url-statepeerDependencies 仍停留在 ^16.8.0 || ^17.0.0 || ^18.0.0,导致用户在 React 19 项目中安装时出现 peer dependency 冲突警告。

变更内容:

  • peerDependencies.react:添加 ^19.0.0
  • peerDependencies.react-dom:添加 ^19.0.0
  • peerDependencies.react-router:添加 ^7.0.0(react-router v7 面向 React 19)
"peerDependencies": {
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
  "react-router": "^5.0.0 || ^6.0.0 || ^7.0.0"
}

源码实现(useRefuseMemoReact.SetStateAction)与 React 19 完全兼容,无需逻辑变更。

📝 更新日志

语言 更新描述
🇺🇸 英文 @ahooksjs/use-url-state: Added React 19 and react-router v7 to peerDependencies
🇨🇳 中文 @ahooksjs/use-url-statepeerDependencies 新增 React 19 和 react-router v7 支持

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI linked an issue Mar 28, 2026 that may be closed by this pull request
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Add React 19 support for use-url-state feat: Add React 19 support to @ahooksjs/use-url-state Mar 28, 2026
Copilot AI requested a review from crazylxr March 28, 2026 15:46
@pkg-pr-new

pkg-pr-new Bot commented Mar 29, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ahooks@2921
npm i https://pkg.pr.new/@ahooksjs/use-url-state@2921

commit: 1d3b2ca

@crazylxr crazylxr closed this Mar 29, 2026
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.

use-url-state react 19 support

3 participants