Can't be used with React Navigation/Drawer V6
See original GitHub issueDescription
Can’t be used with Drawer Navigator in React Navigation.
Expected behavior
Able to create and use Drawer Navigator with no exception.
Actual behavior & steps to reproduce
Just trying to create Drawer object.
import {createDrawerNavigator} from '@react-navigation/drawer';
const Drawer = createDrawerNavigator();
And it throws an error.
ERROR TypeError: null is not an object (evaluating '_ReanimatedModule.default.createNode')
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
Snack or minimal code example
// source: https://reactnavigation.org/docs/drawer-based-navigation
import * as React from 'react';
import {Button, View} from 'react-native';
import {createDrawerNavigator} from '@react-navigation/drawer';
import {NavigationContainer} from '@react-navigation/native';
function HomeScreen({navigation}) {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Button
onPress={() => navigation.navigate('Notifications')}
title="Go to notifications"
/>
</View>
);
}
function NotificationsScreen({navigation}) {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Button onPress={() => navigation.goBack()} title="Go back home" />
</View>
);
}
const Drawer = createDrawerNavigator(); // error
export default function App() {
return (
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={HomeScreen} />
<Drawer.Screen name="Notifications" component={NotificationsScreen} />
</Drawer.Navigator>
</NavigationContainer>
);
}
Package versions
- React Native: 0.65.1
- React Native Reanimated: 2.2.0
- React Navigation Drawer: 6.1.4
- React Navigation Native: 6.0.2
- React Navigation Gesture Handler: 1.10.3
- NodeJS: v16.6.2
- Xcode:
- Java & Gradle: 11.0.12
Affected platforms
- Android
- iOS
- Web
Temporary Resolve Method
It works with "react-native-reanimated": "^1.13.2"
.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:19
- Comments:27 (5 by maintainers)
Top Results From Across the Web
Drawer Navigator | React Navigation
The Drawer Navigator supports both Reanimated 1 and Reanimated 2. If you want to use Reanimated 2, make sure to configure it following...
Read more >Drawer navigation
Common pattern in navigation is to use drawer from left (sometimes right) side for navigating between screens.
Read more >Troubleshooting | React Navigation
Troubleshooting. This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation.
Read more >Getting started - React Navigation
Install the required packages in your React Native project: ... React Navigation is made up of some core utilities and those are then...
Read more >Configuring links | React Navigation
It's not possible to pass params to the initial screen through the URL. So make sure that your initial route doesn't need any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @efefurkankarakaya
We are working on a solution to this problem.
This worked for me.
npm i react-native-reanimated
plugins: ['react-native-reanimated/plugin'],
below presets in ‘<your_app_root_folder>/babel.config.js’.import 'react-native-gesture-handler';
to the top of ‘<your_app_root_folder>/App.js’.npx react-native start --reset-cache
.