From 06887c58c3d0e132c9c2a0fd8a48794398d17d5d Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sat, 16 Dec 2017 23:06:18 +0000 Subject: [PATCH] Fix event types. --- src/components/ContactEdit.tsx | 4 ++-- src/components/EventEdit.tsx | 4 ++-- src/components/LoginForm.tsx | 2 +- src/widgets/DateTimePicker.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/ContactEdit.tsx b/src/components/ContactEdit.tsx index 7fc2f0b..31d4f63 100644 --- a/src/components/ContactEdit.tsx +++ b/src/components/ContactEdit.tsx @@ -83,7 +83,7 @@ const ValueTypeComponent = (props: ValueTypeComponentProps) => { hintText={props.hintText} style={props.style} value={props.value.value} - onChange={(event: any) => props.onChange(props.name, props.value.type, event.target.value)} + onChange={(event: React.ChangeEvent) => props.onChange(props.name, props.value.type, event.target.value)} /> props.onClearRequest(props.name)} @@ -245,7 +245,7 @@ class ContactEdit extends React.PureComponent { this.handleChange(name, value); } - onSubmit(e: any) { + onSubmit(e: React.FormEvent) { e.preventDefault(); let contact = (this.props.contact) ? diff --git a/src/components/EventEdit.tsx b/src/components/EventEdit.tsx index 9fa2f55..08a5332 100644 --- a/src/components/EventEdit.tsx +++ b/src/components/EventEdit.tsx @@ -99,7 +99,7 @@ class EventEdit extends React.PureComponent { } - handleInputChange(event: any) { + handleInputChange(event: React.ChangeEvent) { const name = event.target.name; const value = event.target.value; this.handleChange(name, value); @@ -109,7 +109,7 @@ class EventEdit extends React.PureComponent { this.setState({allDay: !this.state.allDay}); } - onSubmit(e: any) { + onSubmit(e: React.FormEvent) { e.preventDefault(); if ((this.state.start === '') || (this.state.end === '')) { diff --git a/src/components/LoginForm.tsx b/src/components/LoginForm.tsx index 09e1ce3..5352e55 100644 --- a/src/components/LoginForm.tsx +++ b/src/components/LoginForm.tsx @@ -45,7 +45,7 @@ class LoginForm extends React.PureComponent { this.handleInputChange = this.handleInputChange.bind(this); } - handleInputChange(event: any) { + handleInputChange(event: React.ChangeEvent) { const name = event.target.name; const value = event.target.value; this.setState({ diff --git a/src/widgets/DateTimePicker.tsx b/src/widgets/DateTimePicker.tsx index dc7dbaf..5230850 100644 --- a/src/widgets/DateTimePicker.tsx +++ b/src/widgets/DateTimePicker.tsx @@ -28,7 +28,7 @@ class DateTimePicker extends React.PureComponent { this.reportChange = this.reportChange.bind(this); } - handleInputChange(event: any) { + handleInputChange(event: React.ChangeEvent) { const name = event.target.name; const value = event.target.value; this.setState(