Skip to content
Snippets Groups Projects
Verified Commit 53455fa1 authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Included types

parent 91b3fe85
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,6 @@ import React, { useState } from 'react';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox';
const useStyles = makeStyles((theme: Theme) =>
createStyles({
......@@ -36,7 +34,7 @@ export const Form: React.FC = () => {
};
const [formValues, setFormValues] = useState<formData>(defaultValues);
const isEmailValid: any = () => {
const isEmailValid = (): boolean => {
/**
* The following is the RFC 5322 valid email regex
* Hinted from question https://stackoverflow.com/questions/201323/how-to-validate-an-email-address-using-a-regular-expression
......@@ -47,7 +45,7 @@ export const Form: React.FC = () => {
return VALID_EMAIL_REGEX.test(String(formValues.email).toLowerCase());
};
const handleSubmit: any = (event: any) => {
const handleSubmit = (event: React.FormEvent): void => {
event.preventDefault();
const errors: Array<string> = [];
if (!isEmailValid()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment