skip to Main Content

My Codes:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 */
import React from 'react';
import { createDrawerNavigator} from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
import StockRoom from './StockRoom';
const Drawer = createDrawerNavigator();

function Refill(navigation: any): React.JSX.Element {
  interface CustomAlertProps {
    show: boolean;
    onClose: () => void;
  }

  return (
    <NavigationContainer independent={true}>
      <Drawer.Navigator>
        <Drawer.Screen name="Home" component={StockRoom} />
      </Drawer.Navigator>
    </NavigationContainer>
    
  );
}


export default Refill;

First Error:
enter image description here

Second Error:
enter image description here

I need to create a simple drawer but i can’t.
How can i solve this two problem?
I tried npm uninstall and download all packages again but doesn’t work.

2

Answers


  1. I had a very similar issue to this using React Navigation Stack Navigator. It went away for me by deleting node_modules, clearing npm and gradle build caches, reinstalling dependencies. Also, I had to add react-native-reanimated to my project dependencies. After doing this, things were working smooth as butter for me.

    Hope this helps!

    Login or Signup to reply.
  2. The latest version of reanimated is not working properly with the drawer
    try to install this version of reaminated
    npm i [email protected]

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search