Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

368
Vistas
TypeError: navigation.toggleDrawer is not a function. (In 'navigation.toggleDrawer()', 'navigation.toggleDrawer' is undefined) this error occured

TypeError: navigation.toggleDrawer is not a function. (In 'navigation.toggleDrawer()', 'navigation.toggleDrawer' is undefined)
I've called this function as child component in drawer navigation even though it shows error as toggle drawer could not be able access the drawer menu...If anyone can help me to fix this that would be so helpful

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Try use useNavigation

If you use functional component.

import * as React from 'react';
import { Button } from 'react-native';
import { useNavigation } from '@react-navigation/native';

function MyBackButton() {
 const navigation = useNavigation();

return (
   <Button
     title="Back"
     onPress={() => {
       navigation.goBack();
     }}
   />
 );
}

If you use class component.

class MyBackButton extends React.Component {
 render() {
   // Get it from props
   const { navigation } = this.props;
 }
}

  // Wrap and export
     export default function(props) {
     const navigation = useNavigation();

    return <MyBackButton {...props} navigation={navigation} />;
   }
about 4 years ago · Juan Pablo Isaza Denunciar

0

The thing is this error occurs because I should have added that particular component in drawer navigation module. After doing that this error has gone.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda