Go to file
Volodymyr Kozieiev 3f9ca353b5
Readme.md updated
2019-06-20 10:47:10 +03:00
README.md Readme.md updated 2019-06-20 10:47:10 +03:00
index.js Remove hardcoded left-pane size 2019-06-18 13:29:39 +03:00
package-lock.json Initial commit 2019-06-05 12:52:29 +03:00
package.json Initial commit 2019-06-05 12:52:29 +03:00

README.md

react-native-navigation-twopane

Custom two-pane navigator for React Navigation. 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/>
    }
}