Hooks order is changed during update
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
首先定位 FilterContextProvider 和 useStepFlow() API,然后在更新到 React 19 时重现 Hook 顺序警告。跟踪各次渲染之间发生变化的渲染路径,并验证在使用 useStepFlow() 的活动期间 Hooks 顺序保持稳定。
由索引模型根据 Issue 内容生成。
描述
I'm trying to update to the React 19, but the following error occurs
React has detected a change in the order of Hooks called by FilterContextProvider. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks
Previous render Next render
------------------------------------------------------
1. useContext useContext
2. useTransition useContext
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at FilterContextProvider (http://localhost:3000/static/js/index.js:30486:11)
at MainContextProvider (http://localhost:3000/static/js/index.js:58549:73)
at PageMain (http://localhost:3000/static/js/index.js:60277:73)
at Suspense
at ErrorBoundary (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:83480:9)
at errorBoundary(unknown)
at Suspense
at div
at div
at AppScreen (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:104845:11)
at PageLayout (http://localhost:3000/static/js/index.js:27256:73)
at ActivityProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:105918:11)
at StackProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:105956:11)
at PluginRenderer (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:106100:11)
at div
at RoutesProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:105451:22)
at HistoryQueueProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:105284:11)
at MainRenderer (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:106152:11)
at CoreProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:106029:11)
at PluginsProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:106078:11)
at Stack (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:106345:74)
at ThemeProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:27831:52)
at Provider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:120187:29)
at Provider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:120187:29)
at NotificationContextProvider (http://localhost:3000/static/js/index.js:40468:73)
at ToastContextProvider (http://localhost:3000/static/js/index.js:41021:73)
at TransferIdentificationProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:16337:11)
at RelayEnvironmentProvider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:245177:26)
at Provider (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:228803:11)
at Providers (http://localhost:3000/static/js/index.js:19249:73)
at App (http://localhost:3000/static/js/index.js:19145:73)
at Suspense
at ErrorBoundary (http://localhost:3000/static/js/vendors-node_modules_pnpm_amplitude_analytics-browser_2_7_0_node_modules_amplitude_analytics--29d8c0.js:83480:9)
This seems to happen on any activity that calls the useStepFlow() API.
- 主要语言
- TypeScript
- 星标
- 1k
- 派生
- 114
- 平均合并
- 59 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
daangn/stackflow 的其他 Issue
-
스와이프 백 애니메이션 덜컥임 이슈可能重新可做 @Shennng 于 222 天前认领,目前没有进行中的 PR。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
-
Vue3 지원 계획未关闭
难度 5/5 一周以上 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 18/100
-
难度 5/5 一周以上 新手友好度 30/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
agilepathway/label-checker#739 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
CopilotKit/OpenBot#800 ·
维护者通常 1 天内回复
-
Endpoint links in the tag operations list are below the 24px target size可能已有人在做 @AdzerKI 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
ehmpathy/rhachet-roles-bhuild#471 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复