Skip to content

Add useFieldMeta() #5043

Open
Open
@bblanchon

Description

@bblanchon

Is your feature request related to a problem? Please describe.

I created a collection of form components, and I want to style the required fields differently.
I can tell which fields are required by looking at meta.required, but meta is currently only available through useField().

Describe the solution you'd like

I suggest adding useFieldMeta() to return the field's meta.

Describe alternatives you've considered

I tried useField(), but it causes issues when the field needs options (such as {type:"checkbox"}) because it alters the field's behavior.

Adding useFieldRequired()/useIsFieldRequired() would also be a suitable solution to my issue, but I noticed that the documentation never mentions meta.required, so I assume this property isn't always available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions