Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: Exception thrown while executing UI block: put reactNavSuperviewLink back

Tags:

react-native

After I upgraded React Native from 0.14 to 0.26 for my IOS app I am keep getting this exception:

*** Assertion failure in -RCTNavigator reactSuperview, /path_to_app/node_modules/react-native/React/Views/RCTNavigator.m:461 2016-05-20 20:55:43.217 [error][tid:main][RCTUIManager.m:1100] Exception thrown while executing UI block: put reactNavSuperviewLink back

Before the upgrade I did not have this problem. I am using NavigatorIOS.

Any advice on how to fix it or what to even look at while debugging is greatly appreciated

enter image description here

like image 898
Mark Avatar asked May 21 '16 01:05

Mark


3 Answers

Okay no, any answer that includes "Comment out this part of the library" is wrong. Plain and simple.

The issue you are having is a from having you navigatorIOS set up wrong. Make sure you don't have any nested/looping navigators and clean up your code.

Don't rush through it or you will find more issues like this... remember react native is YOUNG and things will break if you are reckless

like image 135
MarcusM. Avatar answered Nov 16 '22 21:11

MarcusM.


When I was trying to solve this problem, in React Native docs there was a statement, that they are aware about million bugs of NavigatorIOS but are no longer working on the component as facebook doesn't use it internally, and they pointed to this library as an alternative for better NavigatorIOS. (back then this library only provided replacement for NavigatorIOS, now they added few more gems) I was going to use it, but then I read that their Navigator does not synchronize between JS and native, that's why instead of using the library I made a decision to stop forcing synchronization between JS and native in React's NavigatorIOS, which solved the problem.

I ended up commenting out RCTAssert(!_bridge.isValid || self.superview != nil, @"put reactNavSuperviewLink back"); in node_modules/react-native/React/Views/RCTNavigator.m.

I know it is a work around, but since React Native approved this library, and many people are happy with, I feel like mirroring what they implemented(not implemented) should be somewhat safe. At least it worked for my app and no further bugs occurred.

like image 2
Mark Avatar answered Nov 16 '22 20:11

Mark


After commenting out the line as indicated in the follow up post by @Mark, I ended up getting a different error Cannot adjust current top of stack beyond available views. Reading up on another thread (React-native on IOS: cannot adjust current top of stack beyond available views) it turns out I wasn't properly importing the component that was being used. Although this turned out to be a "user error" on my behalf, perhaps this might explain other accounts of this error.

like image 1
Rob Avatar answered Nov 16 '22 21:11

Rob