Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

365
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!