-
Notifications
You must be signed in to change notification settings - Fork 490
use react-navigation! #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please . Sticking to React Navigation will be a god send. |
It may not be ideal as React Navigation only has support for Android and iOS - there is no support for UWP... |
Regarding the navigation framework, it was a hard decision for us. In order to fix this we considered two libraries: We ended up switching to NavigationExperimental because it required a minimum amount of change to the framework and it met our performance goals. If you want to use a different navigation library, it's possible to extend similar to how we wrote delegates for Navigator and NavigationExperimental: Unfortunately, ExperimentalDelegate does not currently work with the official version of React Native. In order to support our app's requirements, we made some enhancements to NavigationExperimental which haven't yet been contributed back to Facebook's React Native repo. The primary enhancements are a fade navigation animation (similar to Navigator's) and the ability to provide custom navigation animations. Also, ExperimentalNavigator got deprecated and pulled out from the ReactNative repository, so likely we will move our implementation to the separate reactxp plugin. Our goal was to create a cross-platform framework. Currently, Facebook's NavigationExperimental seems like a reasonable choice as it results in smooth animations in our app and we are able to share navigation code between all platforms Skype is working on. |
@dryganets whatever your reasons back then the way to go now is |
@fotiDim we have nothing to argue about 🤣 I took a closer look at the https://github.com/react-community/react-navigation. In fact, https://reactnavigation.org/ just an ExperimentalNavigation pulled out of the facebook repository into the community one. I was likely looking into the different library before. It was fully native and that was a limitation for us as we need full control over the navigation stack to have a compatibility with the web/desktop version. The ReactNative community is fluid and fast growing. Projects often change authors and names :) We are not trying to limit anyone. Navigation framework choice it's probably the hardest decision in case you are building a cross-platform app as many future architectural decisions would depend on it. |
@dryganets any update on when we can expect the update to react-navigation? |
I started a RN app using react-navigation, but I think I will wait a bit before continuing as I would like to build with XP. Exciting stuff! |
@smkhalsa, we don't have exact plans for this enhancement yet, sorry. |
@dryganets Can we use |
Any updates guys? |
I had to google UWP, not something that most js devs would worry about.. |
We haven't forgotten about this. There are still several items that are higher on the priority list though. |
The core of react-navigation works fine with reactxp, to get it running as is you just need to create reactxp versions of the views used by the different navigator types such as stack/drawer/tab. In doing this though i ran into some challenges with the parity of reactxp animation vs react-native. Unless i'm mistaken it seems there's some quite fundamental limitations with reactxp animation currently - from what i can see you can only have a single interpolation off an animated value (add another and it will overwrite the first), only two values in an interpolation array (as opposed to multiple steps). This functionality is used extensively in the react-navigation views for native like experience. To get around this (driven by a lack of time to consider how to reimplement with reactxp animation) i ended up patching in animatedjs for use on reactxp web navigation views, which provides parity with react-native. Kind of leads me to believe considering animation might be a precursor to react-navigation/more important question. Happy to put up a sample of the above approach to getting react-navigation working with reactxp if of benefit - definitely just for awareness and not production use though! |
@LeJPR - thanks for investigating. Yeah, it would be useful to see what you've done. Perhaps you can check it into a branch? |
will try and grab a few hours of the weekend and get an example up. Great library by the way - i've been refactoring a reasonably complex react-native app into reactxp and have been really impressed with the experience. |
have dropped an example at https://github.com/LeJPR/reactxp-navigation-example. Built reactxp-navigation and reactxp-animation as extensions which i've also published github. |
Eric - off topic a bit for this thread, but would you be open to a PR on animated? If so I'll see if I can figure out how to implement things like multiple animated transforms on a style, multiple interpolations on a value etc. |
@LeJPR, yes, I'm open to it. We've had it on our list for a while, but it's never a high enough priority. If you have time to make improvements to the web implementation of Animated, that would be great. There's a possibility we could reuse some/all of the implementation in react-native-web. I haven't investigated it yet. |
Just wanted to ask, with the current |
@housseindjirdeh we have a separate control for rendering tab views. It is not open sourced yet. |
@dryganets When do you guys plan on open sourcing it? Can you share how to add the tabs based on your suggestion? |
We don't currently have any plans to open-source this component. It has a bunch of complicated features that are specific to the Skype client. |
@erictraut Is it possible to have tabs on the bottom (like react-navigation's) tab navigator? I am not sure how to implement that with ReactXP. |
What functionality are you specifically looking for? Do you need the ability to swipe left/right between tabs? Or are you just looking for a group of tab buttons that selects one of n content panels based on the currently-selected tab? If it's the latter, it's trivial to implement in ReactXP. If you need swiping, it's still possible to implement using ReactXP's GestureView, but it's a bit more involved. |
Yep, the latter :) I didn't see any examples, so wasn't sure how to implement it. So for me coming from React Navigation, we had a Drawer on the left, and Tabs with icons on the bottom (currently selected tab with active icon). I am trying to implement both in ReactXP, but didn't see any examples on how to do that. That's why I am asking here so I can move over my app to React XP and have the same functionality :) Ideally, a react-navigation integration would remedy the need of a different approach and would attract many others that use rn library. Unfortunately, the support on react-navigation is almost non-existent for the last few weeks... But moving forward, how can we implement a drawer + tabs with ReactXP. Any code examples we can implement at this point? |
If you don't need swiping, then you can easily create your own tab bar component that renders the tab bar buttons any way you want. Then lay it out as follows, positioning it below the panel.
|
Thanks for sharing the options @erictraut ! |
Thank you for sharing your thoughts and status with us @LeJPR and @erictraut! @agrcrobles which option number are you referring to for flexibility and scaling better? |
My vote goes to 2. :) |
I am confused with the options :) But I think there are 2 parts to this:
Along with the screen names, some routes will define modal mode to show the sliding up of the screen, a path for the location, and some will have params (at a minimum) This route can be used and not have to worry about
One issue I came across with this is I had to always keep passing the navigate prop everywhere, which was a real pain, instead of using it from a centralized store. Luckily I came across this which worked really well and I only needed to import the store in the scene and was able to use it like this:
I think the navigation syntax across all platforms should work the same way, via a navigation store as opposed to a prop being passed all the time. I am not sure at this point, if there should just be one Those are my thoughts so far, but not sure which option they fall under :) |
I'd vote somewhere between 2 & 3! Preferred Navigation options on react-native don't really have a history of being stable.. so baking it into the RX namespace might cause a headache in the future...as it has now. If there were pluggable options i might start a new project today using an RX extension built on react-navigation, or react-router. In 12 months time if i were to start a project...perhaps airbnb's native-navigation will have web as well, or react-universal-new-fangled-navigation will be flavour of the month. I think at the end your point re: larger form factors is valid as well - in reality i think navigation is one area people will need to get their hands a little dirty, and even if a 'generic' approach were provided, for most apps you're going to need to do some custom stuff to cover all form factors. |
At this moment, it's like the react-navigation maintainers aren't around.. It has been 2 months since their aimed v1 stable release, and started collecting v2 features from users, but no word on v1 stable release update at all (and they're just leaving people hanging, which is not good). It's really annoying that they start off with great enthusiasm to make the "best" react navigation system and then ignore so many issues and dont' look at open PRs. I worry that if we integrate it with ReactXP, it would be the weakest part of ReactXP if it's 100% dependant on react-navigation (solely because of the lack of maintaining the library and no response from the maintainers for a long time now). I really like their API though for its simplicity, but it's also missing some key things like replacing a current scene for example, and issues with drawer/tab navigators. My thoughts are to use their StackNavigator api, or at least the same syntax, but leave out problematic areas such as the other navigators, and instead add them manually as js component in the views with code. If animations were an issue as @LeJPR said, then maybe looking into the areas he was referring to regarding animations, so everything looks correct. I really like ReactXP and their mission and support, and it would be awesome to integrate the StackNavigator API + add few minor custom things, like the replacing of current scene for example. |
I'm sure it will happen. |
I vote for 2....this could be yet another possible abstraction/api: react-router-navigation...just looking at it now, to see what it would take to port it to RXP |
After completing our internal prototyping, I think we're going to go with option #3 for now, with an eye toward #2 or #1 at some point in the future. That means we'll be removing the RX.Navigator namespace and corresponding functionality from ReactXP in the next version. If you want to use stack-based navigation in your RN app, you'll need to choose from among the various options available. Now that we've made this decision, we are unblocked from moving ReactXP to the latest version of React Native (0.46). |
@erictraut Just wondering... Any idea when the ETA for the next ReactXP version is? |
We've continued to publish new minor versions on a pretty regular basis — whenever there are bug fixes that have been pushed. Currently, there are no submitted changes that have not already been published. If you're asking about an ETA for the next major version, it will probably be at least two weeks, maybe three. The developer who has been at the center of this work is currently on vacation. |
Thank you for the quick update. Yup it was about the next major version to use react navigation :) |
Just wondering if anyone was able to get Does anyone have |
@MovingGifts I just found this out, maybe it helps you |
Is anyone aware of any over reactxp and create-react-native-app. I'm trying to decide which one to use. |
@vicentedealencar Yup, I saw that mentioned by @pillowsoft a few comments above. Does it work for both platforms for you guys on ReactXP? @quantuminformation I was thinking the same with ReactXP and create react app, since CRA is zero configuration, so many things have already been done for any app wanting to use it out of the box, not sure if they can work together (having CRA run the web portion of things). I haven't used it though, just using create-xp-app at the moment. I wonder if anyone here is using both? It would be great if it was also zero config with ReactXP as well, so we can focus on just the app code :) |
Is there any solution how to continue with routing, when this feature will be removed from reactxp? In my opinion a common, simple, cross-platform routing functionality is needed. |
@LeJPR - Are you working on a PR to integrate Animated.js? |
@MovingGifts I've dropped all react native dev for now as the platform is still too unstable for me. |
@Roba1993 I hope some examples/documentation emerges on how to route within a ReactXP app for both mobile/web platforms (ideally using a single API). Atm, I don't think anything exists yet. @quantuminformation You can check out Expo (no web). I feel your frustration though, I am really not happy specially with routing and all the cumbersome configs. I just want to code my app views with simple routing for mobile/web, push to production easily (app stores/push to online server) and be done! I guarantee within a few years, it will all be drag and drop to build for different platforms, with routing built in, pushing to production, and everything will be so easy. But until then, we gotta grind or drop it.. |
My biggest gripe is all the random build errors like bundlejs and npm etc. Whether its CRA, RN or ReactXP. I'm going for PWA's for now. |
@Fitzpasd - did a prototype of using animatedjs for reactxp animation, however at this stage will not be submitting PR. From the looks of it the animatedjs repo is no longer actively worked on - taking some of the concepts and building out reactxp animated is probably the way to go I would think. |
I currently have ReactXP working on mobile with Can someone share with us how to get |
@MovingGifts -probably a bit off topic for here. But to summarise they don't provide 'out of the box' navigators/views for web - you have to create your own. In short I don't think you're going to get a 'magic bullet' for navigation Multiplatform. |
@LeJPR Thanks for your feedback. Looks like |
https://microsoft.github.io/reactxp/docs/components/navigator.html
my guess is that when you guys built this there is no react-navigation, is it possible to adopt https://reactnavigation.org/ instead of creating one more navigation lib/API, we already have plenty now ;)
The text was updated successfully, but these errors were encountered: