reactjs / reactjs/react.dev

Docs - sample code updates needed?

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

还没有人认领这个 Issue。

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

描述

There seems to be confusion on how to write class components in the docs. Using this as a starting point for other pages which may need to be updated.

There is a mixture of function declaration and class components in the docs which can be confusing as when someone may want or need to use either method. Since the release of hooks, the docs should have a new site version release (similar to how Babel has site versions) with the updated, preferred way to write components backed by the core team.

in CONTRIBUTING.md, it shows that you should write classes with a constructor, but the Blog post titled "Update on Async Rendering" seems to prefer the former method of writing components.

Can this be solidified and added to the docs where necessary? Will there be a need to have a new site version with focus on function declaration components?

🥇

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先,将 CONTRIBUTING.md 中关于类组件的指导与博客文章 "Update on Async Rendering" 进行比较,然后列出受影响的文档页面。确认核心团队首选的指导方式,以及是否需要新的站点版本;当指导内容和必要示例都得到一致更新时,工作即告完成。

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

评估

技术栈
javascript, react
领域
documentation
Issue 类型
文档
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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