v2.0.0
v2 includes a slightly redesigned api that allows for easier support of use cases such as disabled item state or custom ripple effect on the buttons. There are breaking changes, but if you followed the previous advice on "How to integrate in your project", migration should be easy. There are no changes to styling of the buttons.
Breaking:
cancelButtonLabel
prop was removed, provide customonOverflowMenuPress
if you relied on this prop.
to get the same behavior and customize the cancel label used on ActionSheetIOS
, the replacement will look more or less like this
const onOverflowMenuPressIOS = ({ hiddenButtons }) => {
let actionTitles = hiddenButtons.map(btn => btn.props.title);
actionTitles.push('your cancel label');
ActionSheetIOS.showActionSheetWithOptions(
{
options: actionTitles,
cancelButtonIndex: actionTitles.length - 1,
},
(buttonIndex: number) => {
if (buttonIndex !== actionTitles.length - 1) {
hiddenButtons[buttonIndex].props.onPress();
}
}
);
};
IconElement
was renamed toButtonElement
HeaderButtons
expects different props now - instead ofIconComponent
,iconSize
andcolor
you're expected to passHeaderButtonComponent
prop
If you were using this library together with react-native-vector-icons
, you will also be required to import HeaderButton
and wrap it in your own component providing the IconComponent
, iconSize
and color
props, as documented here.
Please see the example screens or run the improved example app.