import React, { useState } from "react"; import { Form, Alert, Button, Input } from "antd"; import { useHistory } from "react-router-dom"; import UserService from "../service/UserService"; export default function RegisterPage() { const [error, setError] = useState(); const history = useHistory(); const onSubmit = ({ email, password, fullName }) => { UserService.register(email, password, fullName) .then(() => history.push("/login")) .catch((err) => { setError(err); }); }; const layout = { labelCol: { span: 8 }, wrapperCol: { span: 4 }, }; const tailLayout = { wrapperCol: { offset: 8, span: 4 }, }; return ( <> {error && }
); }