I am learning react navigation and facing issues on drawer navigation. Below is my code and package details,
dependencies in package.json
"@react-navigation/drawer": "^6.6.15",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"react": "18.2.0",
"react-native": "0.74.1",
"react-native-gesture-handler": "^2.16.2",
"react-native-reanimated": "^3.12.0",
"react-native-safe-area-context": "^4.10.4",
"react-native-screens": "^3.31.1"
babel.config.js
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: ['react-native-reanimated/plugin'],
};
code
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {createDrawerNavigator} from '@react-navigation/drawer';
import Home from './Screens/Home';
const Drawer = createDrawerNavigator();
const Router = () => {
return (
<NavigationContainer>
<Drawer.Navigator>
<Drawer.Screen name="HomeScreen" component={Home} />
</Drawer.Navigator>
</NavigationContainer>
);
};
export default Router;
I am getting error as
Error: [Reanimated] Failed to create a worklet. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#failed-to-create-a-worklet for more details., js engine: herme
TypeError: Cannot read property ‘isConfigured’ of undefined
I have tried deleting node module and reinstall all dependencies, also tried
npx react-native run-ios — –reset-cache
Things are working fine when using stack navigator , but not working when using drawer navigator.
Please help me in resolving this issue. I am using M1 chip MacBook and trying to build the app on iOS simulator