Integrating Schema with TanstackForm: Handling Validation Results

Hello there, I'm integrating Schema with TanstackForm via the https://standardschema.dev/. From my perspective, everything in Schema is working respecting the standard, but I had to force the validator not to return the validator result, but undefined, to avoid the validation to fail. Is this expected in your experience?
const form = useForm({
  defaultValues: props.previewer satisfies typeof ShowerPreviewerInput.Encoded,
  onSubmit: data => {
    console.log("submit", data)
  },
  validators: {
    onChange: data => {
      const result = standardSchema.validate(data.value)
      return "issues" in result ? result.issues : undefined
    },
  },
})
Was this page helpful?