You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: workflow.yaml
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -23,28 +23,28 @@ nodes:
23
23
steps:
24
24
- name: "AI Code Review"
25
25
ai:
26
-
model: "gpt-4o-mini"
26
+
model: "gpt-4o-mini"
27
27
max_tokens: 8000
28
28
prompt: |
29
29
IMPORTANT: A codemod (`react-declassify`) has ALREADY attempted to transform React class components to function components in this repository.
30
30
Most files are COMPLETE, but `react-declassify` has known limitations and leaves markers where it fails. Your job is to REVIEW, FIX, and FINISH the transformations.
31
-
31
+
32
32
CRITICAL: You MUST provide verbose output explaining what you're doing at each step!
33
33
Output your progress as you work so users can see what's happening.
34
-
34
+
35
35
Step 1: Search for Hard Errors and Soft Errors
36
36
- Search the project for `react-declassify-disable Cannot perform transformation`. This indicates a HARD ERROR where the tool gave up. You MUST manually convert this entire class to a function component with Hooks yourself!
37
37
- Search the project for `TODO_this`. This indicates a SOFT ERROR where the tool didn't know how to bind or resolve `this`. Fix the scoping and state/prop references.
38
-
38
+
39
39
Step 2: Address react-declassify's Known Limitations
40
40
- Class Refs: If the old class was receiving refs or being instantiated via `useRef`, the new functional component will break. You MUST wrap the component in `React.forwardRef` and use `useImperativeHandle` to expose the necessary methods/properties!
41
41
- Stricter Render Types: If the component returns a bare string/number and TypeScript complains about `FC<Props>`, wrap the return statement in a fragment `<> ... </>`.
42
-
42
+
43
43
Step 3: Review common transformation issues
44
44
- Fix missing or incorrect dependency arrays in useEffect hooks
45
45
- Ensure all setState calls use the functional updater when depending on previous state
46
46
- Add missing cleanup functions in useEffect where needed
47
-
47
+
48
48
Step 4: ALWAYS output a clear summary
49
49
You MUST provide a detailed summary at the end including:
0 commit comments