requirements
need a Drawer Navigator, as shown in figure
question
at present, my routing configuration is wrong. I can only open the sideslip navigation component when routing to Drawer.
I want a navigation component that can be opened by sliding to the right on any page. What should I do?
Code
App.js
/* * /* export default class App extends React.Component { render () { return ( <Navigation /> ) } }
. / router/index.js
import IndexScreen from "../pages/Index" import DrawerScreen from "../components/Drawer" export default createStackNavigator({ Index: IndexScreen, Drawer: DrawerScreen }, { initialRouteName: "Index" })
. / componnets/Drawer.js
class All extends React.Component {static navigationOptions = {
drawerLabel: "" }
render () {
return ( <Text></Text> ) } } class Good extends React.Component { static navigationOptions = { drawerLabel: "" }
render () {
return ( <Text></Text> ) } }
export default createDrawerNavigator ({All, Good}, {
initialRouteName: "All"})