hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.6k stars 679 forks source link

DateRange.updatePreview : ReferenceError: Cannot access 'color' before initialization #658

Open Syxou opened 1 week ago

Syxou commented 1 week ago

DateRange.updatePreview : ReferenceError: Cannot access 'color' before initialization

init the color before initialisation

const color = ranges[focusedRange[0]]?.color || rangeColors[focusedRange[0]] || color;

[BUG] Bug Reproduce Steps

Just render the DateRange component and do hover some date.

[BUG] Expected behaviour

Show the hover

Environment

Package Version: 2.0.1 React version: 17 Node version: 18 Browser: chrome