0

I met the error below when I using react-native-firebase with react-navigation(and also react-native-gesture-handler)

undefined is not an object (evaluating 'RNGestureHandlerModule.State')

I followed the guide of https://rnfirebase.io/docs/v5.x.x/installation/ios

below is call stack of error screen.

<unknown>
GestureHandler.js: 54:37
<unknown>
Swipeable.js: 11
<unknown>
index.js:1
<unknown>
StackViewLayout.js:19
<unknown>
StackView.js:4
<unknown>
createStackNavigator.js:3

here is my package.json

"dependencies": {
  "axios": "^0.18.0",
  "react": "16.6.3",
  "react-native": "0.57.8",
  "react-native-dialog": "^5.5.0",
  "react-native-firebase": "^5.2.0",
  "react-native-gesture-handler": "^1.0.12",
  "react-native-safari-view": "^2.1.0",
  "react-native-vector-icons": "^6.1.0",
  "react-navigation": "^3.0.9",
  "react-redux": "^6.0.0",
  "redux": "^4.0.1",
  "redux-logger": "^3.0.6",
  "redux-promise-middleware": "^5.1.1",
  "redux-thunk": "^2.3.0" }

here is my source code using react-navigation

const AppStack = createBottomTabNavigator({
  Main: {
    screen: Main
  }, 
  Setting: {
    screen: Setting
  }
})
const AuthStack = createStackNavigator({
  Login: {
    screen: Login
  },
  Join: {
    screen: Join
  },
  JoinDetails: {
    screen : JoinDetails
  }
})
const AppContainer = createAppContainer(createSwitchNavigator(
{
  AuthLoading: AuthLoadingScreen,
  App: AppStack,
  Auth: AuthStack
},
{
  initialRouteName: 'AuthLoading',
}))

and I did below command at project root

react-native link react-native-gesture-handler

if I comment createStackNavigator in javascript source code, error was disappeared.

could you anyone help me? I've struggled with this issue during a few days.

Nuno Nam
  • 1
  • 1
  • Hi, your description is confusing. In the title you talk about rn-firebase, in the description the error you are listing is about RNGestureHandlerModule. So is firebase udnefined or RNGestureHandlerModule? What are you doing in your authStack? – Daniel Dimitrov Jan 21 '19 at 12:59
  • @DanielDimitrov sorry, I changed the title, and added callstack of error screen and there are components regarding Authentications in authStack – Nuno Nam Jan 21 '19 at 14:12
  • Did you try unlink and uninstall react-native-gesture-handler and react-navigation? – sdkcy Jan 21 '19 at 14:15
  • @sdkcy sure, I install and link them again and again, so many times. – Nuno Nam Jan 21 '19 at 14:24
  • I don't see how this is related to rn-firebase. There is too little information here to be able to effectively help you, but your issue seems similar to this: https://github.com/kmagiera/react-native-gesture-handler/issues/205 Are you using cocoa Pods? If yes, then after linking you'll have to go inside the ios folder and run `pod install` – Daniel Dimitrov Jan 21 '19 at 19:42

1 Answers1

1

try to run this commands :

  • npm install
  • npm install --save react-navigation
  • npm install --save react-native-gesture-handler
  • react-native link
Ala'a
  • 75
  • 1
  • 4