Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Hooks order is changed during update

未关闭
#469 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

daangn/stackflow 的其他 Issue

查看 daangn/stackflow 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。