reactjs / reactjs/react.dev

The double rendering of lifecycle methods in Strict Mode needs to be presented more loudly

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

还没有人认领这个 Issue。

主要语言
JavaScript
星标
11.8k
派生
7.9k
平均合并
1 天 11 小时
30 天内合并 PR
11

描述

I have just lost a day's work wondering why my GSAP animations weren't working only to realize the double call in strict mode. While I understand the reasons for strict mode, I still think having a Caveats section or something to warn developers would be highly beneficial.

I did stumble on this GSAP thread and it seems like both sides are just saying "It's not really my problem" while we the developers kind of suffer.

Now, I do know of the existence of the changelog but new developers wouldn't be aware of this issue right away and I just want to save their time. So, maybe having a Gotchas section where you can just write some notes regarding how strict mode calling twice may affects 3rd party libraries like GSAP's from() tweens could help developers tackle this issue early? Just my two cents.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先定位现有的 Strict Mode 文档,并查看其中如何呈现其注意事项和 changelog。添加一条醒目的警告,说明生命周期方法会渲染两次,以及这对 GSAP 等第三方库的影响;当新开发者无需搜索 changelog 就能找到这些指南时,即可完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, react
领域
documentation
Issue 类型
文档
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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