v4.0.0
Welcome to v4!
This is, from a fair part, a rewrite. The basic usage remains the same, so migration should not be too hard. If you're using Flow or Typescript, that will make it even easier - both typings should be solid!
Improvements
✅Greater component reuse across screens:
Previously, if you used eg. <HiddenItem title="search" iconName="ios-search" onPress={() => alert('search')} /> in one screen, you couldn't really use it in another one. Now you can - just create a component that wraps it, eg. like this:
const ReusableHiddenItem = ({ onPress }) => <HiddenItem title="hidden2" onPress={onPress} />;
✅New overflow menu handler: Material dropdown menu
This is material dropdown menu adapted from react-native-paper, credit for amazing job goes to them. This Menu is bundled in this library (no dependency on react-native-paper).
To use it, pass overflowMenuPressHandlerDropdownMenu as onPress to OverflowMenu (this is the default for Android and Web)
✅Cleaner api:
- new
OverflowMenucomponent - some props have been moved to
OverflowMenu
✅Experimental web support
- for overflow menu, you need to use the Material Menu (pass
overflowMenuPressHandlerDropdownMenuasonPresstoOverflowMenu)
✅CI improvements
- Flow, Jest tests and ESLint run in CI. I'd like to check TS validity too (by checking the example project) - please open a PR if you're using TS.
Breaking Changes
Because so much has changed, this may not be complete list. Let me know if I forgot something.
❌ changed
showprop is removed -> useItemorHiddenItemcomponentoverflowButtonWrapperStyle-> passstyletoOverflowMenuonOverflowMenuPress-> passonPresstoOverflowMenuoverflowButtonTestID-> passtestIDtoOverflowMenubuttonWrapperStyle-> renamed tostyle- if you want an
ItemorHiddenItemto be disabled, passdisabled={true}prop
Known Issues
see https://github.com/vonovak/react-navigation-header-buttons#known-issues