Это моя следующая js-форма
Код: Выделить всё
const onSubmit = async (data: ShopFormValues) => {
setLoading(true)
try {
const response = await fetch("https://***********.com/register.php", {
method: "POST",
body: JSON.stringify({ firstname: "example" }),
// ...
});
console.log(response)
} catch (error: any) {
console.log('Network error!')
}
finally {
setLoading(false)
}
};
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/790 ... hp-backend