react-date-range icon indicating copy to clipboard operation
react-date-range copied to clipboard

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

Open Syxou opened this issue 1 year ago • 2 comments

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

Syxou avatar Nov 13 '24 21:11 Syxou

When using the Google Close Compiler with the library, I get a similar error:

Closure compilation failed with 1 errors
 --- node_modules/react-date-range/dist/components/DateRange/index.js:145
Illegal variable reference before declaration: color

bgalartza avatar Feb 06 '25 15:02 bgalartza

Related or duplicated: https://github.com/hypeserver/react-date-range/issues/642 https://github.com/hypeserver/react-date-range/issues/474

bgalartza avatar Feb 06 '25 15:02 bgalartza