How to use NativeBase DatePicker

user2457870 picture user2457870 · Jun 10, 2018 · Viewed 16.7k times · Source

Given this DatePicker Api from NativeBase v2.5.1 how am I supposed to capture the change date event with the new selected date?

If I understand well the selected date is only available in the internal state of the component:

setDate(date) {
    this.setState({ chosenDate: new Date(date) });
}

I imagine I can use the react native ref api but it doesn't seem right since other similar components do offer the onDateChange event, eg: react-native-datepicker