import React,{useRef} from 'react'; import { confirmAlert } from 'react-confirm-alert'; // Import import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css export const RegistrationForm = (props): 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(props.updateData(2), e.target.reset()) confirmAlert({ title: 'Confirm to submit', message: 'Are you sure to do this.', buttons: [ { label: 'Yes', onClick: () => alert('Click Yes') }, { label: 'No', onClick: () => alert('Click No') } ] }); } return ( <>
Введите актуальные данные команды
От каждого учебного заведения может быть зарегистрированно неограниченое количеставо команд