refactor(text-area): migrate TextArea from Flow to TypeScript - #4761
Conversation
WalkthroughChangesThe PR adds typed TextArea components
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Formik
participant TextAreaField
participant TextArea
participant NativeTextarea
Formik->>TextAreaField: Provide field and form state
TextAreaField->>TextAreaField: Resolve touched and error state
TextAreaField->>TextArea: Pass value, error, label, and ref
TextArea->>NativeTextarea: Render textarea with ARIA attributes and forwarded props
TextArea-->>Formik: Display field and validation state
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
38ec496 to
42d689c
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/text-area/TextArea.tsx`:
- Around line 57-62: Conditionally assign aria-errormessage in the TextArea
ariaAttrs object only when hasError is true, otherwise use undefined; apply this
change in src/components/text-area/TextArea.tsx (lines 57-62) and
src/components/text-area/TextArea.js.flow (lines 55-60).
In `@src/components/text-area/TextAreaField.tsx`:
- Around line 13-25: Update TextAreaField in
src/components/text-area/TextAreaField.tsx#L13-L25 to forward
isRequired={isRequired} to TextAreaPrimitive while preserving the
caller-provided hideOptionalLabel value. Mirror the same prop-forwarding
correction in src/components/text-area/TextAreaField.js.flow#L12-L18.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 838a920e-29f7-45da-971b-4a53799ab359
⛔ Files ignored due to path filters (2)
src/components/text-area/__tests__/__snapshots__/TextArea.test.tsx.snapis excluded by!**/*.snapsrc/components/text-area/__tests__/__snapshots__/TextAreaField.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (8)
src/components/text-area/TextArea.js.flowsrc/components/text-area/TextArea.tsxsrc/components/text-area/TextAreaField.js.flowsrc/components/text-area/TextAreaField.tsxsrc/components/text-area/__tests__/TextArea.test.tsxsrc/components/text-area/__tests__/TextAreaField.test.tsxsrc/components/text-area/index.js.flowsrc/components/text-area/index.ts
Merge Queue Status
This pull request spent 45 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
Convert TextArea component to TypeScript
This PR converts
src/components/text-areafrom JavaScript with Flow to TypeScript.Changes
TextArea.jstoTextArea.tsxwith exportedTextAreaPropsinterfaceTextAreaField.jstoTextAreaField.tsxwith exportedTextAreaFieldPropsinterfaceindex.jstoindex.ts, re-exporting the components and their types__tests__/TextArea.test.jsand__tests__/TextAreaField.test.jsto.tsx.js.flowfiles for backward compatibilityTesting
src/components/text-area; all 17 pass with snapshots matching previous outputyarn lint:tsandflow checkpassSummary by CodeRabbit