import React, { useEffect, useState } from "react"; import DatePicker from "react-datepicker"; export const DatePickerRangeInput = ({ startDate, endDate, setFilterDate }) => { const [_startDate, setStartDate] = useState(startDate) const [_endDate, setEndDate] = useState(typeof(endDate) === 'string' ? new Date(endDate) : endDate) const handleDateChanges = (dates) => { const [start, end] = dates; setStartDate(start); setEndDate(end); if (end !== null) { setFilterDate(dates) } } return (