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

Fix ReferenceError by removing uninitialized color fallback

Open AbbassJaber opened this issue 8 months ago • 1 comments

Types of changes

What types of changes does your code introduce?

Put an x in the boxes that apply

  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description

The existing implementation causes a reference issue with color, as it can unintentionally fallback to itself, leading to incorrect behavior. By removing || color, the assignment correctly prioritizes ranges[focusedRange[0]]?.color and rangeColors[focusedRange[0]], preventing unintended references.

Related Issue: #xxx

AbbassJaber avatar Mar 10 '25 12:03 AbbassJaber

component was not released since 2021. Why do you send a PR?.. Do you think the will be a new release?

I'm curious because the component is quite ld now and has compatibility problems with new versions of react.

drmax24 avatar May 19 '25 14:05 drmax24