React-native-navigation: [V2] Cannot read property 'topTabs' of undefined

Created on 13 Jun 2018  ·  6Comments  ·  Source: wix/react-native-navigation

Issue Description

I have updated my RN project from V2.0.2242 to V2.0.2349, and on iOS it is failing to load the application, when checking debug it shows a warning of "Cannot read property 'topTabs' of undefined"

Checking though my application, I have not got topTabs defined anywhere. If i need to define it where would I define it? Thank you.

Steps to Reproduce / Code Snippets / Screenshots

screen shot 2018-06-13 at 12 32 12

YellowBox.js:80 Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot read property 'topTabs' of undefined TypeError: Cannot read property 'topTabs' of undefined at LayoutTreeParser.parse (blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:70029:25) at Commands.setRoot (blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:69811:50) at Navigation.setRoot (blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:3440:38) at AppContainer.startApp (blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:1549:43) at blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:1539:17 at tryCallOne (blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:5690:14) at blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:5791:17 at blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:5074:21 at _callTimer (blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:4963:9) at _callImmediatesPass (blob:http://localhost:8081/7922237c-4650-4d85-b633-f057f801c398:4999:9)


Environment

  • React Native Navigation version: 2.0.2349
  • React Native version: 0.55.4
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): iPhone X, simulator 11.4, debug
🏚 stale

Most helpful comment

I had a similar issue. Have you added root at the top level when invoking setRoot.

Navigation.setRoot({
  root: {
    // whatever you had before
  },
})

After changing this, the issue you mentioned went away but then I got a new issue, see below...

Exception '-[__NSCFBoolean countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x10ef946b0' was thrown while invoking setRoot on target RNNBridgeModule with params (...

Update

I was able to resolve the next issue by adding root to the top level object for setDefaultOptions

Navigation.setDefaultOptions({
  root: {
    // whatever you had before
  },
})

_BTW It looks like your RN & RNN versions ar flipped_

All 6 comments

I had a similar issue. Have you added root at the top level when invoking setRoot.

Navigation.setRoot({
  root: {
    // whatever you had before
  },
})

After changing this, the issue you mentioned went away but then I got a new issue, see below...

Exception '-[__NSCFBoolean countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x10ef946b0' was thrown while invoking setRoot on target RNNBridgeModule with params (...

Update

I was able to resolve the next issue by adding root to the top level object for setDefaultOptions

Navigation.setDefaultOptions({
  root: {
    // whatever you had before
  },
})

_BTW It looks like your RN & RNN versions ar flipped_

The main problem was two changes that happened:

{ statusBarStyle: 'light', largeTitle: true }

Ara now invalid options. You should use:

{ statusBar: { visible: true }, largeTitle: { visible: true }, }

After fixing it you can use setRoot.

@gabrielvcbessa ya I just noticed that myself. Thanks for the update! 👍

@nickofthyme Are you facing something like this #3362 ?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

The issue has been closed for inactivity.

Was this page helpful?
0 / 5 - 0 ratings