Skip to content

Migrating to version 2.0

Markus Wind edited this page Dec 9, 2018 · 5 revisions

The customization of styles was very limited in version 1.x.x, which is why passing full style objects has been added in version 2.x.x. But this addition comes with breaking changes, this chapter will explain how to migrate to version 2.0.

Properties in version 1.x.x

In previous versions it was possible to have limited custom styles like this:

{
  buttonsBackgroundColor: '#FFFFFF',
  buttonsBorderColor: '#FFFFFF',
  buttonsBorderWidth: 0,
  buttonsTextColor: '#FFFFFF',
  buttonsTextSize: 13,
  keyboardBackgroundColor: '#FFFFFF'
}

Properties in version 2.x.x

From version 2.0 you are able to pass full style objects to the KeyboardButtons, KeyboardButtonsView, Picker and PickerItem like this:

// NOTE: these views are only shown on iOS
{
  buttonsTextStyle: {},
  buttonsViewStyle: {},
  pickerItemStyle: {},
  pickerViewStyle: {}
}

Migrating from v1.x.x to v2.x.x

When you had custom styles in v1.0 you have to convert them like this:

{
  buttonsTextStyle: {
    color: '#FFFFFF', // buttonsTextColor
    fontSize: 13 // buttonsTextSize
  },
  buttonsViewStyle: {
    backgroundColor: '#FFFFFF', // buttonsBackgroundColor
    borderColor: '#FFFFFF', // buttonsBorderColor
    borderBottomWidth: 0, // buttonsBorderWidth
  },
  pickerViewStyle: {
    backgroundColor: '#FFFFFF', // keyboardBackgroundColor
  }
}
Clone this wiki locally