@@ -12,46 +12,78 @@ APIs.
12
12
13
13
This will start an interactive wizard, and then run the specified transform.
14
14
#### Running with ` codemod ` CLI
15
- ` npx codemod <transform> --target <path> [...options] `
15
+ ` npx codemod <framework>/<version>/< transform> --target <path> [...options] `
16
16
* ` transform ` - name of transform, see available transforms below.
17
17
* ` path ` - directory to transform
18
18
19
- Check [ codemod docs] ( https://docs .codemod.com/deploying-codemods/ cli] ) for the full list of available commands.
19
+ Check [ codemod docs] ( https://go .codemod.com/cli-docs ] ) for the full list of available commands.
20
20
21
21
### Included Transforms
22
22
23
23
#### ` remove-context-provider `
24
24
25
25
Converts ` Context.Provider ` JSX opening and closing elements into ` Context ` .
26
26
27
+ Run with ` react-codemod ` CLI for basic experience:
28
+
27
29
``` sh
28
30
npx react-codemod remove-context-provider < path>
29
31
```
30
32
33
+ or use ` codemod ` CLI for better experience and support:
34
+
35
+ ``` sh
36
+ npx codemod react/19/remove-context-provider --target < path>
37
+ ```
38
+
31
39
#### ` remove-forward-ref `
32
40
33
41
Removes usages of ` forwardRef ` .
34
42
43
+ Run with ` react-codemod ` CLI for basic experience:
44
+
35
45
``` sh
36
46
npx react-codemod remove-forward-ref < path>
37
47
```
38
48
49
+ or use ` codemod ` CLI for better experience and support:
50
+
51
+ ``` sh
52
+ npx codemod react/19/remove-forward-ref --target < path>
53
+ ```
54
+
39
55
#### ` remove-memoization-hooks `
40
56
41
57
Removes usages of ` useCallback ` , ` useMemo ` and ` memo ` .
42
58
59
+ Run with ` react-codemod ` CLI for basic experience:
60
+
43
61
``` sh
44
62
npx react-codemod remove-memoization-hooks < path>
45
63
```
46
64
65
+ or use ` codemod ` CLI for better experience and support:
66
+
67
+ ``` sh
68
+ npx codemod react/19/remove-memoization-hooks --target < path>
69
+ ```
70
+
47
71
#### ` use-context-hook `
48
72
49
73
Replaces usages of ` React.useContext(...) ` with ` React.use(...) ` .
50
74
75
+ Run with ` react-codemod ` CLI for basic experience:
76
+
51
77
``` sh
52
78
npx react-codemod use-context-hook < path>
53
79
```
54
80
81
+ or use ` codemod ` CLI for better experience and support:
82
+
83
+ ``` sh
84
+ npx codemod react/19/use-context-hook --target < path>
85
+ ```
86
+
55
87
#### ` create-element-to-jsx `
56
88
57
89
Converts calls to ` React.createElement ` into JSX elements.
0 commit comments