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