react-date-range
react-date-range copied to clipboard
Fix ReferenceError by removing uninitialized color fallback
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
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.