Error Device: (3:9741) (0,l.useLinkBuilder) is not a function. (In '(0,l.useLinkBuilder)()', '(0,l.useLinkBuilder)' is undefined)

Viewed 1570

Why am I getting error Device: (3:9741) (0,l.useLinkBuilder) is not a function. (In '(0,l.useLinkBuilder)()', '(0,l.useLinkBuilder)' is undefined) for the below code? I am trying to nest a stack navigator inside a drawer navigator. The code below is for the drawer navigator and my stack is the stack navigator.

MyDrawer.js

import * as React from 'react';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { createAppContainer } from '@react-navigation/native';
import MyStack from './MyStack';
import AdvertStack from './AdvertStack';

const Drawer = createDrawerNavigator({

      Home: {
        screen: MyStack
        },

      Advert: {
        screen: AdvertStack
      }
});

export default createAppContainer(Drawer);
2 Answers

I was able to solve that by updating @react-navigation/native and @react-navigation/drawer to their last versions.

your problem is regarding the latest versions of react navigation, try to update it.

If you are using expo do the following steps:

1 - Access the file: package.json

2 - Find the libs:

    "@react-navigation/stack": "*",
    "@react-navigation/native": "*",
    "@react-navigation/bottom-tabs": "*",

3 - Modify your version:

    "@react-navigation/stack": "5.0.5",
    "@react-navigation/native": "5.0.5",
    "@react-navigation/bottom-tabs": "5.0.5",

4 - Ready! Probably your problem has been solved, if not, reinstall the library with:

    npm install @react-navigation/native
Related