Fix #1082: pass ref through Field custom component path - #1097
Conversation
Field is a forwardRef wrapper. The string-component branch already forwards ref via createElement; the custom-component branch dropped it in v7. Restore the pre-v7 pass-through so custom components receive the ref. Fixes final-form#1082
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesField ref forwarding
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This restores forwarded refs for custom Field components and is covered by a regression test; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
FieldisReact.forwardRef. The string-componentpath already passesrefthroughReact.createElement. The custom-componentpath dropped it in v7 (renderComponent({ children, component, ...rest, ...mergedField })).Restore the pre-v7 pass-through so a custom component receives the forwarded ref.
Reported by @barettjfed.
Fixes #1082
Summary by CodeRabbit
React.forwardRef.