SchemaFieldcomponent

SchemaField({ schema, children, ...props }: SchemaFieldProps): ReactElement
ParamType
propsSchemaFieldProps
Props for SchemaField: SchemaInput props plus optional children to override the input. required
Return
ReactElement
A <Field> wrapping the schema's input.

Show the appropriate input for a schema, wrapped in a <Field> with its label and message.

  • Renders custom children inside the field, or a SchemaInput when none are provided.

Examples

<SchemaField name="email" schema={EMAIL} /> // Outputs a `<Field>` wrapping a `<TextInput>`.
<SchemaField name="age" schema={AGE} /> // Outputs a `<Field>` wrapping a `<NumberInput>`.