Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

366
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda