Skip to content

Commit 8718267

Browse files
committed
Describe its needs
1 parent f6bb276 commit 8718267

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ This codemod automatically transforms **React class components** into **React fu
1313
- ✅ Designed to generate as idiomatic code as possible. Not something Babel or Webpack would generate!
1414
- ✅ Based on classical heuristic automation; no need to be fearful about whimsy LLMs.
1515

16+
## Why do we need this?
17+
18+
Class components are [still going to be supported by React for the foreseeable future](https://react.dev/reference/react/Component). However, it is no longer recommended to write new components in class-style.
19+
20+
So what about the existing components? Although React will continue to support these, you may struggle to maintain them because:
21+
22+
- New libraries and new versions of existing libraries tend to focus on Hooks-style components, and you may find you in a difficulty adopting the components to the libraries.
23+
- Class components may appear alien to those who are young in React development experience.
24+
25+
Thus it is still a good idea to migrate from class components to Hooks-based components.
26+
27+
However, as this is not a simple syntactic change, migration needs a careful hand work and a careful review. This tool is a classic automation, it reduces a risk of introducing human errors during migration.
28+
1629
## Usage
1730

1831
```

0 commit comments

Comments
 (0)