React-native-modal-datetime-picker: Differing behavior between iOS and Android without supplying date prop

Created on 23 May 2018  路  4Comments  路  Source: mmazzarolo/react-native-modal-datetime-picker

As of v4.0.0, the iOS and Android pickers behave the same when providing the date prop. Great!

However, they behave differently when not providing date as a prop. The iOS picker stores the selected date internally as state and thus remembers your previous selection. On Android, it defaults to new Date() every time the picker is re-opened.

One option includes making date a required prop and eliminating state within the iOS component. This matches the React philosophy of lifting state up and avoids potential sync issues while also simplifying the iOS picker code.

Thoughts?

enhancement help wanted

All 4 comments

@jkdf2
thanks for starting the discussion.

One option includes making date a required prop and eliminating state within the iOS component. This matches the React philosophy of lifting state up and avoids potential sync issues while also simplifying the iOS picker code.

Yes, I absolutely agree with this.
I thought about making this change in the past but I never had a chance to do it.
Anyone available for submitting this PR?

how to change datepicker header color on android?

i want to make it blue or something not green? thanks :)

Fixed by #179 , will be released on npm soon

Was this page helpful?
0 / 5 - 0 ratings