File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 11
11
* use the ` --dry ` option for a dry-run and use ` --print ` to print the output for comparison
12
12
13
13
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.
14
20
15
21
### Included Transforms
16
22
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
+
17
55
#### ` create-element-to-jsx `
18
56
19
57
Converts calls to ` React.createElement ` into JSX elements.
You can’t perform that action at this time.
0 commit comments