form icon indicating copy to clipboard operation
form copied to clipboard

feat(core): field meta API

Open harry-whorlow opened this issue 9 months ago • 6 comments

Field.meta

From issue #1111 and discussion #709, this pr Introduces the Field.meta api to allow for extensible and easily accessible meta data to the field component.

example api

<form.Field
  name="foo"
  meta={({ values }) => ({
    disabled: values.someOtherField == null,
    ...
  })}
>
  {(field, meta) => 
  <Comp
    disabled={meta.disabled}
    ... >
  </Comp>

Tasks

  • [x] Meta available to Field.children
  • [ ] MetaFn available to form.Field
  • [ ] Tests
  • [ ] LGTM 🚀

harry-whorlow avatar Jan 22 '25 09:01 harry-whorlow