Trigger onDatesChange only when BOTH dates are selected
See original GitHub issueCurrent behaviour for DateRangePicker is that onDatesChange is triggered on EVERY date select, to and from
How to trigger onDatesChange only when BOTH dates has been selected? I know I can compare new and current dates, but I want to avoid this kind of hacking. It there some out of the box approaches?
`to` => `from` => onDatesChange( only now it is triggered )
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Trigger onDatesChange only when BOTH dates are selected
Current behaviour for DateRangePicker is that onDatesChange is triggered on EVERY date select, to and from How to trigger onDatesChange only ...
Read more >How can I trigger a method when end date is changed
You need to use onFocusChange and onDatesChange props of <DateRangePicker> , and also componentDidUpdate() React lifecycle method:.
Read more >react-dates - npm
You can control the selected dates using the startDate , endDate , and onDatesChange props as shown below. The DateRangePicker also manages ...
Read more >Date Range Picker — JavaScript Date & Time Picker Library
singleDatePicker : (true/false) Show only a single calendar to choose one date, instead of a range picker with two calendars. The start and...
Read more >react-dates-patched-x0r - npm package - Snyk
You can control the selected dates using the startDate , endDate , and onDatesChange props as shown below. The DateRangePicker also manages ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Here is my solution:
@majapw hey im saying the same thing. It should be logic that the parent component should handle ! i just provided the snippet haahah