...would appreciate an explanation here.
[0]: https://github.com/airbnb/native-navigation/blob/91ae656192d...
Having said that, it kind of feels hacky. I have certainly seen this in various codebases and I can't comment on react native but just with standard iOS programming it often points to a lack of understanding of lifecycle or similar order of when things are happening.
A concrete example of a problem I had was when setting a text field to be first responder when displayed. The result was that the keyboard was trying to appear a split second after the push segue animation fired.
(IIRC you can reproduce it fairly trivially in a pure native app by calling `-becomeFirstResponder` asynchronously inside a `viewWillAppear:` block. The result was two animations fighting for screen layout, and a giant white empty block where the keyboard should be.)
The solutions were to: a) wait, or b) fire synchronously in `-viewWillAppear:`. Airbnb seem to have chosen a).
https://github.com/wix/react-native-navigation
The problem with all the JS based navigation stacks for React Native (react-native-router-flux, react-router, React Navigation) that I have tried is that if you need to have a back stack, they keep the previous scene in memory. i.e if you look at the 3D view hierarchy in XCode you will see the screen prior to the one you pushed.
This really sucks for overdraw perf and completely breaks accessibility on Android. See:
https://react-native.canny.io/feature-requests/p/navigator-b...
I liked Leland's metaphor of calling apps like Airbnb which started out without React Native as "brown field" development and calling apps that start out as React Native "green field" development.
FWIW those are pre-existing industry terms (not React Native or mobile specific)
In there you'll see that React Navigation is a solution aimed at "Green Field" projects (as Leland Richardson from Airbnb calls new React Native projects) and replaces Navigator, Navigation Experimental, and Ex-Navigation. On the other hand, Native Navigation is aimed at "Brown Field" projects (like Airbnb's app, which was built in native much before React Native was open sourced) and replaces NavigatorIOS.
You can also see that various features in the roadmap are in collaboration with other organizations (Expo for Create React Native App and Airbnb for React Native Maps).
Indeed React Native has been moving extremely fast but after our decision to go with it over a year ago we've never thought even once about going back.
React Navigation, released a few weeks ago, includes a customizable JS re-implementation of the native views, and it also provides routers that make it very easy to plug your navigation logic into redux. Because each screen makes no assumption about the surrounding app, it will be very easy to switch from React Navigation to AirBnB's native-navigation.
The RN community has been consolidating efforts between several navigation solutions. React Navigation is an alternative to Navigator, Ex-Navigator, NavigationExperimental, and Ex-Navigation. And now, thanks to native-navigation, the community has a great alternative to NavigatorIOS.
Wow, you guys have a tight curve you're staying ahead of :-)
React Navigation is a module for React (which has been around for four years). Instead of having to DIY navigation, you now can use the native system's (iOS/Android) navigation layout. Ex: https://reactnavigation.org/
You're not replacing your tools. You're just getting someone else to coat your drill bits for you to save time.
I just started using React today, so I may be off here, but I think it's pretty straightforward if you googled it.
Otherwise, if you're referring to how "bleeding edge" the guy has to be, I'd imagine he's in a competitive field (or passionate about his projects).
Hell, I'm not in either of those categories, but I think I'll start using this because it looks really helpful.
In case you're implying this was a "beat them to market" situation, it wasn't. Both navigation projects have been on React Native's public roadmap for several months: https://github.com/facebook/react-native/wiki/Roadmap/_compa...
Improved navigation has been one of the RN community's highest-voted feature requests: https://react-native.canny.io/feature-requests/p/better-navi...
http://airbnb.io/native-navigation/docs/guides/basic-usage.m...
# Basic Usage
_This documentation has not been created yet. Sorry about that! Hang tight!_React Navigation seems to be the framework that is endorsed by the react native team. However, Airbnb's React Native Navigation library seems to be more proven since they had been using it in production. I am wondering if anyone know what are the benefits of using React Native Navigation vs React Navigation
"The problem with all the JS based navigation stacks for React Native (react-native-router-flux, react-router, React Navigation) that I have tried is that if you need to have a back stack, they keep the previous scene in memory. i.e if you look at the 3D view hierarchy in XCode you will see the screen prior to the one you pushed."
The docs for airbnb's new navigation stack says the following:
http://airbnb.io/native-navigation/
"React Native Navigation by Wix engineering is an alternative library that uses "Native" navigation components of each platform, and has been around longer than Native Navigation. If you need a stable / production-ready navigation library today that uses native platform based navigation components, we recommend you check this library out."
They also claim they are not using this library in their main app yet.
I'll be writing up a blog post about my experiences with the wix nav stack migration once we get our app out.
It's a shame the situation around navigation stacks with React Native is so confusing right now.
Would be really interested in this, have been looking at doing exactly the same and am attempting to quantify how much work it would take.
The React Native team respects Airbnb's work here a lot as well. I think we will end up with an "official recommendation" that says each of react-navigation and native-navigation is better for a different set of use cases. It's probably too early to figure out precisely what the line is.
Roughly, react-navigation is more customizable, native-navigation works better for native <-> RN transitions, and they should each be easier to use than the "first generation" of navigation solutions like Navigator / NavigatorIOS / NavigationExperimental.
> If you are investigating navigation solutions and you are okay with JavaScript-based solutions, we also encourage you to check out React Navigation.
However if you go to React Navigation home page [1] you find this:
> Navigation views that deliver 60fps animations, and utilize native components to deliver a great look and feel.
It looks like every RN navigation library claims to be more "native" than the previous ones.
AirBnB's native-navigation library literally has native iOS and Android code to create views, transitions etc.
react-navigation on the other hand is mostly JS driven, instead using the core functionality of React Native, which does generate native views.
The problem with react-navigation (and many libraries using a similar approach) is that you don't get a true native feel once you start interacting with the UI. This is because the JS -> native bridge is async, meaning you literally can't handle events as quickly as they're dispatched in native code - particularly if the events are synchronous.
I'm a huge fan of AirBnb's approach. Doing things in JS just because you "can" is inherently broken (as described above). Checkout the following Github issue for a demonstration of the issue: https://github.com/react-community/react-navigation/issues/1...
Also, I am a little bit confused, because react-navigation makes it sound like there are going to be merged into core once stable:
Once stable, NavigationExperimental will be deprecated in favor of React Navigation. React Navigation is a collaboration between people from Facebook, Exponent and the React community at large. [1]
What do you guys make of that statement?
This is important because Apple can still make changes to Swift which can break language backward compatibility.
This happened last wwdc. So if you use any third party libraries that are written in swift they won't work till the authors or you update them to the new language conventions.
The wix native library which they reference is written in objective c so this won't have that problem.
Also:
On iOS, ViewController transitions can be animated using Lottie. It's possible we could add support for such a feature into Native Navigation.
Yes please.
App-wide support for 100% native navigation with an easy cross-platform interface. For iOS, this package is a wrapper around react-native-controllers, but provides a simplified more abstract API over it. This abstract API will be unified with the Android solution which is currently work in progress. It also fully supports redux if you use it.
What does this mean?
Did you try the first sentence?
> Native Navigation is a navigation library for the React Native platform.
There you go, that's what it is.
If you don't have this problem and/or don't work on React Native apps, move on. If you're trying to learn and don't know what problems a navigation library solves, or don't know what view controllers in iOS development are, or don't know what redux is, or something else in the line you posted, try googling it and then looking at the examples in the library.
It sounds to me, after reading the above and googling "React Native" for <10 minutes, that this library handles the UI navigation for mobile phone apps written in React Native, and it does so in a way that allows your code to work across multiple operating systems (presumably iOS and Android). This library is also compatible with redux, a very popular state manager.
There's no one standard routing/navigation library in the community. As that's quite an important part of almost every app, a new high quality solution is something that any React Native dev would be interested in.
I'm sure you know who AirBnB are. They've spent the last year (?) building part of their mobile apps with React Native, and this is their home-grown navigation library.
Now, most React Native components (including navigation libraries) are built almost entirely in JavaScript, but this one is one of a few which "bridge" the native iOS and Android APIs, potentially resulting in a more natural and familiar feel.
There's one other semi-native nav option out there, Wix's React Native Navigation[1]. I've not personally tried either of them, but it's nice to have choices.
There are lots of JavaScript-based routing systems out there. React Navigation[2] is the closest we've got to an officially sanctioned package in a while, being the successor to two very popular libraries (Facebook's own NavigationExperimental[3] and Exponents Ex-Navigation[4]).
There's also React Native Router Flux[5], which is quite popular, and the very popular React Router[6] has support for React Native in their recently released v4.
As you can see, there are quite a few options available, and there are even more if you want to delve deeper[7]
[1]: https://github.com/wix/react-native-navigation
[2]: https://reactnavigation.org/
[3]: https://github.com/facebook/react-native/tree/master/Librari...
[4]: https://github.com/exponent/ex-navigation
[5]: https://github.com/aksonov/react-native-router-flux
nifty looking guy
react-native-controllers
I think you may be reading the docs for the Wix navigation library instead of the Airbnb one linked above.