foolish-indigoF
Refine3y ago
6 replies
foolish-indigo

Using useRegister example, throws a type error.

I'm using the example provided that's listed under pages/customRegisterPage: https://refine.dev/docs/api-reference/core/hooks/authentication/useRegister/

I've removed any extra code that I added (just page styling) and used just the absolute basic example but I'm getting the following type error. Any idea what might be causing that?

Type '(values: RegisterVariables) => void' is not assignable to type 'FormEventHandler<HTMLFormElement>'.
  Types of parameters 'values' and 'event' are incompatible.
    Type 'FormEvent<HTMLFormElement>' is missing the following properties from type 'RegisterVariables': email, passwordts(2322)
index.d.ts(1412, 9): The expected type comes from property 'onSubmit' which is declared here on type 'DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>'
useRegister data hook from refine is a modified version of react-query's useMutation for registration.
useRegister | refine
Was this page helpful?