fix type of event argument in onSubmit

* Fix type of event argument in onSubmit

* Don't use alert in test code
This commit is contained in:
orangain 2019-10-04 07:27:05 +09:00 committed by Ryan Cavanaugh
parent 25d2c9665b
commit e69cfea13f
2 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@ import { TextFieldProps } from "material-ui";
export interface ValidatorFormProps {
className?: string;
onSubmit: (event: React.FormEventHandler) => void;
onSubmit: (event: React.FormEvent) => void;
instantValidate?: boolean;
onError?: (errors: any[]) => void;
debounceTime?: number;

View File

@ -6,7 +6,9 @@ import {
} from 'react-material-ui-form-validator';
class Test extends React.Component {
onSubmitted = (event: React.FormEventHandler) => {};
onSubmitted = (event: React.FormEvent) => {
event.preventDefault(); // Actually preventDefault() is called by ValidatorForm
}
onError = (errors: any[]) => {};
onValidate = (isValid: boolean) => {};