import React, { FunctionComponent, useState } from 'react'; import { useHistory } from 'react-router-dom'; import AuthenticationService from '../services/authentication-service'; type Field = { value?: any, error?: string, isValid?: boolean }; type Form = { username: Field, password: Field } const Login: FunctionComponent = () => { const history = useHistory(); const [form, setForm] = useState