The Field component provides the necessary context for its children to react
to changes in the form state, as well as provides necessary information about the field,
such as the ids needed for aria attributes, and a lot more.
Each Field creates its own context, and the children of the field only access
the immediate parent's context.
Props
The Field component doesn't render an element, it strictly provides context.
Slot Props
The following slot props are provided for convenience and ease of composition when using the Field component.
Composition
Since the Field component doesn't render any HTML elements, it's a common practice to create a wrapper component around it to have consistent styling and behavior across your forms.
For example, you may always want to render the FieldErrors component for every field. Instead of manually including it every time, you can create a wrapper <CustomField /> component that includes it automatically.
To maintain the type safety of the component, we'll need to use some generics, which eslint sometimes complains about, so if you see a warning, it's likely a false positive and you can ignore it.