TanStackT
TanStack2y ago
2 replies
faint-white

validateFormData in Solid Start Action

I'm currently testing out TanStack Form in SolidJS, and was trying to see how well I could get it working with the Actions built into Solid Start. Here's a code snippet of what I'm working with
var formFactory = createFormFactory(() => ({
  defaultValues: {
    username: "",
    password: "",
  },
  validatorAdapter: zodValidator,
}));

const login = action(async (formData: FormData) => {
  "use server";
  ...
});

For the react version, I see you can add onServerValidate to the form factory, which lets you call formFactory.validateFormData(formData); in the action. I don't see an equivalent for SolidJS though, is that somewhere else or not implemented yet?
Was this page helpful?