It was done this way so the BirthDate could be validated and composed in PassengerForm on button click.
But solving #836 noticed thatDateInput.ios.js wouldnt require any validation and therefore the onDateChange would be outputting correct Date right away, so it would be working differently depending on the platform.
What would be the best approach to solve it?
1) Try to refactor DateInput.js by pre filling day, month and year so it would be returning date on button click
2) Keep components different and pass different props depending on the platform
The existing DateInput.js has this props
which are controlled by the
PassengerForm.js
state andonDateChange
is called every time one of the time periods changesIt was done this way so the BirthDate could be validated and composed in
PassengerForm
on button click.But solving #836 noticed that
DateInput.ios.js
wouldnt require any validation and therefore theonDateChange
would be outputting correct Date right away, so it would be working differently depending on the platform.What would be the best approach to solve it?
1) Try to refactor
DateInput.js
by pre filling day, month and year so it would be returning date on button click2) Keep components different and pass different props depending on the platform