If i select a custom range, the onClose correctly return startDate and endDate but if i pick one value from the ranges it will break since returns undefined.
I have to find a way to grab the updated startDate and endDate inside the onClose function also if i select one range.
Here the example: https://codesandbox.io/s/clever-shamir-gyi0m?file=/src/App.js
Had to modify the library, you can find a fix for this here: https://github.com/Matteobikk90/react-dates-presets
Essentially onClose were not sending the values(startDate, endDate) if the user was selecting a range.