if we want to update value of initial date range after api call it is not accepting the value
for example for the first time if i send {startDate: '2024-03-13', endDate: '2024-04-13'} and later if update my value to {startDate: '2024-03-13', endDate: '2024-05-13'} it is still showing selected range is this({startDate: '2024-03-13', endDate: '2024-04-13'})
you have to take new prop like selected daterange to update
or please add useEffect in to update daterange in your code with dependency array initialDateRange
if we want to update value of initial date range after api call it is not accepting the value for example for the first time if i send {startDate: '2024-03-13', endDate: '2024-04-13'} and later if update my value to {startDate: '2024-03-13', endDate: '2024-05-13'} it is still showing selected range is this({startDate: '2024-03-13', endDate: '2024-04-13'})
you have to take new prop like selected daterange to update or please add useEffect in to update daterange in your code with dependency array initialDateRange
useEffect(()=>{ setdaterange({...initialDateRange}) },[initialDateRange])