Skip to content

Commit dd5dea5

Browse files
committed
update readme
1 parent fcd2ebd commit dd5dea5

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,47 @@ APIs.
1111
* use the `--dry` option for a dry-run and use `--print` to print the output for comparison
1212

1313
This will start an interactive wizard, and then run the specified transform.
14+
#### Running with `codemod` CLI
15+
`npx codemod <transform> --target <path> [...options]`
16+
* `transform` - name of transform, see available transforms below.
17+
* `path` - directory to transform
18+
19+
Check [codemod docs](https://docs.codemod.com/deploying-codemods/cli]) for the full list of available commands.
1420

1521
### Included Transforms
1622

23+
#### `remove-context-provider`
24+
25+
Converts `Context.Provider` JSX opening and closing elements into `Context`.
26+
27+
```sh
28+
npx react-codemod remove-context-provider <path>
29+
```
30+
31+
#### `remove-forward-ref`
32+
33+
Removes usages of `forwardRef`.
34+
35+
```sh
36+
npx react-codemod remove-forward-ref <path>
37+
```
38+
39+
#### `remove-memoization-hooks`
40+
41+
Removes usages of `useCallback`, `useMemo` and `memo`.
42+
43+
```sh
44+
npx react-codemod remove-memoization-hooks <path>
45+
```
46+
47+
#### `use-context-hook`
48+
49+
Replaces usages of `React.useContext(...)` with `React.use(...)`.
50+
51+
```sh
52+
npx react-codemod use-context-hook <path>
53+
```
54+
1755
#### `create-element-to-jsx`
1856

1957
Converts calls to `React.createElement` into JSX elements.

0 commit comments

Comments
 (0)