Releases: vonovak/react-navigation-header-buttons
v2.1.0
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:
cancelButtonLabelprop was removed, provide customonOverflowMenuPressif 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();
}
}
);
};IconElementwas renamed toButtonElementHeaderButtonsexpects different props now - instead ofIconComponent,iconSizeandcoloryou're expected to passHeaderButtonComponentprop
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.
v1.2.0
This release includes a new onOverflowMenuPress?: ({ hiddenButtons: Array<React.Element<*>> })=>any prop which you can use to handle tapping on the overflow button. This may be handy if the default handlers do not fit your needs.
onOverflowMenuPress accepts a single parameter - an object with hiddenButtons key.
v1.1.0
v1.0.0
v0.0.8
you can now import Please note this was removed in 1.0.0HeaderButtons with predefined IconComponent, see the comparison.
ex:
import { IoniconHeaderButtons, Item } from 'react-navigation-header-buttons'
static navigationOptions = {
title: 'Usage With Icons',
headerRight: (
<IoniconHeaderButtons color="blue">
<Item title="add" iconName="ios-search" onPress={() => console.warn('add')} />
<Item title="select" onPress={() => console.warn('edit')} />
</IoniconHeaderButtons>
),
};