Open musamaalvi opened 3 years ago
does replacing the line with
const color = ranges[focusedRange[0]]?.color || rangeColors[focusedRange[0]] || color;
solve the problem?
Same version i have used but still same issue ,"cannot read properties of undefined reading color" in react-date-range , how to resolve this .
Have you been able to solve this problem?
I'm facing the same issue
Is anyone able to resolve the issue?
I was stuck in the issue for so long but I find out that You can Specify the color in range
const CustomDatePicker = () => { const [state, setState] = useState([ { startDate: new Date(), endDate: new Date(), key: "selection", color: "#010E48", // Specify the color in the range array }, ]); return ( <DateRangePicker onChange={(item) => setState([item.selection])} showSelectionPreview={true} moveRangeOnFirstSelection={false} months={2} ranges={state} direction="horizontal" /> ); };
Subject of the issue
Its crashing in one of the functions of react-date-range. It seems on this line inside
[BUG] Bug Reproduce Steps
Just installed npm install react-date-range -save
It gives me below mentioned error when simply project is run and clicked on date range anywhere.
[BUG] Expected behaviour
Environment
Package Version: TypeScript version: 4.2.3 React version: 17.0.1 Node version: 16.10 Browser: Chrome