Skip to content

feature(ReactHookForm): add useFieldProps hook - #2375

Draft
ins0 wants to merge 2 commits into
mainfrom
feature/custom-field-components
Draft

feature(ReactHookForm): add useFieldProps hook#2375
ins0 wants to merge 2 commits into
mainfrom
feature/custom-field-components

Conversation

@ins0

@ins0 ins0 commented Mar 11, 2026

Copy link
Copy Markdown
Member

These updates make it easier to build custom form fields and manage their props and errors in a consistent way.

Enhancements to field prop management and context:

  • Introduced FieldPropsContext and the useFieldProps hook to provide field props via React context, enabling more composable and reusable custom field components. (useFieldProps.tsx)
  • Updated the Field component to wrap its children with FieldPropsContext, ensuring that child components can access field props from context. (Field.tsx)
  • Refactored type definitions for FieldProps and ForwardedFieldProps to improve type safety and support for custom field components. (Field.tsx)

Type and API improvements:

  • Updated the useUpdateFormDefaultValue hook to support generic field names and provide better type safety. (useUpdateFormDefaultValue.ts)
  • Refactored internal field component prop types for improved flexibility and composability. (useFieldComponent.tsx)

Storybook and documentation:

  • Added a new Storybook story (CustomField.stories.tsx) demonstrating how to build custom field components using the new context and hooks, including error handling and focus management examples.

@github-actions

github-actions Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 82.24% 264 / 321
🔵 Statements 82.56% 270 / 327
🔵 Functions 89.85% 62 / 69
🔵 Branches 71.34% 122 / 171
File CoverageNo changed files found.
Generated in workflow #4861 for commit 70d956f by the Vitest Coverage Report Action

@ins0
ins0 marked this pull request as draft March 18, 2026 07:12
@mfal mfal added the post-1.0 Does not block the 1.0.0 cut — lands after 1.0.0 label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

post-1.0 Does not block the 1.0.0 cut — lands after 1.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants