Skip to content

Commit

Permalink
fix: flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alaa-yahia committed May 30, 2024
1 parent 83352bc commit 8cd2340
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ type Props = {
calendar: string,
};

export class DateField extends React.Component<Props, State> {
handleDateSelected: (value: string) => void;
export class DateField extends React.Component<Props> {
handleDateSelected: (value: {calendarDateString: string}) => void;

constructor(props: Props) {
super(props);

this.handleDateSelected = this.handleDateSelected.bind(this);
}

handleDateSelected(value) {
handleDateSelected(value: {calendarDateString: string}) {
const date = value?.calendarDateString;
this.props.onBlur(date);
this.props.onDateSelectedFromCalendar && this.props.onDateSelectedFromCalendar();
Expand Down Expand Up @@ -53,6 +53,7 @@ export class DateField extends React.Component<Props, State> {
}}
>
<CalendarInput
{...passOnProps}
onDateSelect={this.handleDateSelected}
calendar={calendarType}
date={this.props.value}
Expand All @@ -61,7 +62,6 @@ export class DateField extends React.Component<Props, State> {
onFocus={this.props.onFocus}
editable
disabled={this.props.disabled}
{...passOnProps}
/>
</div>
);
Expand Down

0 comments on commit 8cd2340

Please sign in to comment.