Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Syxou opened this issue Nov 13, 2024 · 2 comments

Comments

@Syxou
Copy link

Syxou commented Nov 13, 2024

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

@bgalartza
Copy link

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
Copy link

bgalartza commented Feb 6, 2025

Related or duplicated: #642 #474

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants