SchemaFieldcomponent
SchemaField({ schema, children, ...props }: SchemaFieldProps): ReactElement| Param | Type | |
|---|---|---|
props | SchemaFieldProps | 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
childreninside the field, or aSchemaInputwhen 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>`.