Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

155
Vistas
Hamburger Menu position in React Native

i am trying to move the hamburger menu from left to right in react native. Unfortunately I can't. Can anyone help me please ...? This is the code:

import * as React from 'react';
import { View, Text } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { DrawerActions } from '@react-navigation/native';
import pageArticle from "./pages/article";
import pageFeed from "./pages/feed";

const Drawer = createDrawerNavigator();

const MyDrawer = () => {
  return (
    <Drawer.Navigator 
        initialRouteName="Feed"
        screenOptions={{
            drawerPosition: 'right',
        }}
    >
        <Drawer.Screen name="Feed" component={pageFeed}
        
        />
        <Drawer.Screen name="Article" component={pageArticle} />
    </Drawer.Navigator>
  );
}

export default function App() {
  return (  
    <NavigationContainer>
        <MyDrawer />
    </NavigationContainer>
    
  );
}

With the command drawerPosition: 'right', I can put the drawer on the right but not the hamburger menu.

Please... Help me...

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can render a custom header component and put the menu button where ever you want.

   <Drawer.Navigator 
            initialRouteName="Feed"
            screenOptions={{
                drawerPosition: 'right',
                header: (props) => {
                    return <CustomHeaderComponent {...props}/>
              }
             }}
        >
7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos