reactjsreact-nativenavigation-drawer

React Native Drawer - Cannot read Property "isConfigured" of undefined & [Reanimated] Failed to create a worklet


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.


Solution

  • Add this inside the your babel.config.js:

    module.exports = {
      presets: ['module:@react-native/babel-preset'],
      plugins: ['react-native-reanimated/plugin']
    };
    

    After reconfiguring babel:

    yarn start --reset-cache