isSchema
A type guard to check if a value is a valid valibot schema.
1import { isSchema } from '@conform-to/valibot/future';
2
3if (isSchema(value)) {
4 // value is a valibot schema
5}#Parameters
value
The value to check.
#Returns
Returns true if the value is a valid valibot schema, false otherwise.
#Example
Use isSchema to restrict what schema types your forms accept. This narrows down the types for the validateSchema option:
1import { configureForms } from '@conform-to/react/future';
2import { isSchema } from '@conform-to/valibot/future';
3
4const { useForm } = configureForms({
5 isSchema,
6 validateSchema(schema, payload) {
7 // schema is now typed as a valibot schema
8 },
9});