From 3f9ca353b5fcb9882e8e0a1e4a48daae7373100f Mon Sep 17 00:00:00 2001 From: Volodymyr Kozieiev Date: Thu, 20 Jun 2019 10:47:10 +0300 Subject: [PATCH] Readme.md updated --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cdf606f..e86f5ff 100644 --- a/README.md +++ b/README.md @@ -1 +1,47 @@ -# react-native-navigation-twopane \ No newline at end of file +# 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 + } +} + +```