Untitled

 avatar
unknown
plain_text
2 years ago
432 B
8
Indexable
const { handleSubmit } = useForm();

const submitPayment = async () => {
  const res = await UserAPI.getProductById('xxxxxxx');

  if (res.status === 'success') {
    console.log(res);
  }

  setTimeout(() => {
    window.open('https://detik.com', "_blank");
  });
};

<Button variant="contained" type="submit" onClick={() => handleSubmit(submitPayment)} sx={{ width: 251, fontSize: { xs: 12, sm: 14 } }}>
  Sample Button
</Button>
Editor is loading...