WordPress/gutenberg

Code Quality: Refactor all React class components to functional components using hooks

Open

#22,890 创建于 2020年6月4日

在 GitHub 查看
 (53 评论) (12 反应) (0 负责人)JavaScript (3,893 fork)batch import
Good First Issue[Package] Components[Status] In Progress[Type] Code Quality[Type] Tracking Issue

仓库指标

Star
 (9,607 star)
PR 合并指标
 (平均合并 12天 18小时) (30 天内合并 509 个 PR)

描述

The official recommendation for writing React components is as follows.

All components should be implemented as function components, using hooks for managing component lifecycle and state.

If you're a new/junior contributor looking to help with this refactoring, follow these steps:

  • Search for class components on the codebase (For example by searching extends Component
  • Pick a component to refactor.
  • Comment on this issue saying that you're working on the said component.

Note This is a tracking issue for the React components guidelines. This issue is tailored specifically for junior and new contributors. Experienced contributors shouldn't do big refactorings unless they update the code for another reason (bug fix, feature).

贡献者指南