Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 流类型函数_Reactjs_Flowtype - Fatal编程技术网

Reactjs 流类型函数

Reactjs 流类型函数,reactjs,flowtype,Reactjs,Flowtype,我想养成正确输入所有内容的习惯。我键入了以下几个函数: handleStartDateClick = (event: SyntheticEvent<HTMLElement>) => { event.stopPropagation(); this.setState({ selectDate: SELECT_DATE.START }); }; handleEndDateClick = (event: SyntheticEvent<HTMLElement>) =

我想养成正确输入所有内容的习惯。我键入了以下几个函数:

handleStartDateClick = (event: SyntheticEvent<HTMLElement>) => {
  event.stopPropagation();
  this.setState({ selectDate: SELECT_DATE.START });
};

handleEndDateClick = (event: SyntheticEvent<HTMLElement>) => {
  event.stopPropagation();
  this.setState({ selectDate: SELECT_DATE.END });
};

任何帮助/建议都会很好

考虑在Flow的不和中提问

handleClearDates=startDate:Date,endDate:Date=>event:event=>{ 事件。停止传播; 如果开始日期| |结束日期{ this.props.client.writeData{ 数据:{ 选定日期:[], }, }; this.setState=>{ 选择日期:选择日期。开始, }; }否则{ 这个。handleDayPickerClose; } }; 也可能是事件:合成事件:无效?
handleClearDates = (startDate, endDate) => (event) => {
  event.stopPropagation();
  if (startDate || endDate) {
    this.props.client.writeData({
      data: {
        selectedDates: [],
      },
    });

    this.setState(() => ({
      selectDate: SELECT_DATE.START,
    }));
  } else {
    this.handleDayPickerClose();
  }
};