Readme.md updated

This commit is contained in:
Volodymyr Kozieiev 2019-06-20 10:47:10 +03:00 committed by GitHub
parent 47311f0653
commit 3f9ca353b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 47 additions and 1 deletions

View File

@ -1 +1,47 @@
# react-native-navigation-twopane
# react-native-navigation-twopane
Custom two-pane navigator for [React Navigation](https://reactnavigation.org/). Implements master/detail pattern. Built on top of Stack navigator.
## Usage
The only difference from Stack navigator is that in routes config additional field `emptyRightPaneName` should be set.
```
import {
createAppContainer,
createBottomTabNavigator,
} from 'react-navigation';
import {createTwoPaneNavigator} from "react-native-navigation-twopane";
const routes = {
Item: {
screen: ItemScreen,
},
List: {
screen: ListScreen,
},
Details: {
screen: DetailsScreen,
},
NoChats: {
screen: NoChatsScreen,
},
};
const routesConfig = {
initialRouteName: 'List',
emptyRightPaneName: 'NoChats'
};
const MasterDetailNavigator = createTwoPaneNavigator(routes, routesConfig);
const AppContainer = createAppContainer(MasterDetailNavigator);
export default class App extends React.Component {
render() {
return <AppContainer/>
}
}
```