Bug: global.IS_REACT_ACT_ENVIRONMENT = false does not disable missing act warnings
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, react
- 领域
- frontend, testing-qa
调研方向
通过克隆链接的 react-18-act-env 示例、安装依赖并运行所述的 npm test 命令来复现该警告。检查调整后的 App 组件及其围绕异步状态更新和 global.IS_REACT_ACT_ENVIRONMENT 的测试;完成的标准是更新仍能完成,且不会记录缺少 act 的警告。
由索引模型根据 Issue 内容生成。
描述
This issue was first created in facebook/react, see https://github.com/facebook/react/issues/24854.
The rational behind why we want to disable act warnings: https://github.com/facebook/react/issues/23197
Potentially related to using jest. Didn't confirm.
React version: 18.2.0
Steps To Reproduce
- Clone https://github.com/anilanar/react-18-act-env ; which is a
create-react-appwith an adjustment toAppcomponent to trigger an asyncsetStateand an adjustment to the test to wait for that async state update. npm installnpm test -- --watchAll
The current behavior
It logs Warning: An update to App inside a test was not wrapped in act(...).
The expected behavior
It does not log that warning.
- 主要语言
- JavaScript
- 星标
- 19.7k
- 派生
- 1.2k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
testing-library/react-testing-library 的其他 Issue
-
fireEvent.select does not wrap its automatic native focus in act可能已有人在做 @sergioperezcheco 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
-
bug: calling configure() without reactStrictMode resets it to undefined, silently disabling strict mode可能重新可做 @suhailopensource 于 72 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
testing-library/react-testing-library#1466 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
testing-library/react-testing-library#1459 · 2 条评论 ·
-
perf: optimize container lookup with early exit可能重新可做 @Ch-Abhinav-Chowdary 于 298 天前认领,目前没有进行中的 PR。 未关闭
难度 1/5 1 小时以内 新手友好度 35/100
testing-library/react-testing-library#1430 · 1 条评论 ·
-
`fireEvent.mouseEnter` does not forward `relatedTarget` (relatedTarget is the window instead)可能已有人在做 @swarnim02 于 316 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
查看 testing-library/react-testing-library 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
no-human-ai/no_human#659 ·
维护者通常 1 天内回复
-
[BUG] Multi-day events show "Ended" while still in progress可能已有人在做 @tarunagnihotri534 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 85/100
data-umbrella/du-event-board#231 · 2 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 78/100
-
IO.get_env on Node truncates names at embedded NUL可能已有人在做 @Yi-111-a 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
HigherOrderCO/Bend#1449 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 72/100
cryptpad/documentation#162 ·