I am using tcomb
to build a form in react-native
, a field in my form is birthDate: t.maybe(t.Date)
, but it appears to have no style
const formRegistration = t.struct({
// other fields
birthDate: t.maybe(t.Date)
});
I have also added config
down the options
:
const options = {
fields : {
birthDate: {
label: 'Birth Date',
mode: 'date',
config: {
format: (date) => myFormatFunction('DD MM YYYY', date),
dialogMode: 'spinner'
}
}
}
}
};
Looking at this: https://github.com/gcanti/tcomb-form-native/blob/master/lib/stylesheets/bootstrap.js The style for the date is in
dateValue
at line 196so this is what I did to style it according to the need:
you follow the same way to style other key parts in tcomb (e.g: labels:
Form.stylesheet.controlLabel.normal.fontSize = 14;
)