useSubmission
action
const action = useSubmission(register);
export const register = action(async (data: FormData) => { const username = data.get("username"); const password = data.get("password"); const repeatPassword = data.get("passwordRepeat"); if(password !== repeatPassword) { throw redirect("/register?error=..."); }});