import React,{useRef} from 'react'; export const RegistrationForm = (): JSX.Element => { const form = useRef(null); const submit = e => { const data =[]; e.preventDefault(); const form = e.target; // eslint-disable-next-line no-console for (let i = 0; i < e.target.length-1; i++) { data.push(form[i].value); } JSON.stringify(data); //console.log(data); fetch('/api/registration', { method: 'POST', body: data }) // .then(res => res.json()) // .then(json => setUser(json.user)) } return ( <>
Введите актуальные данные команды