How can I create gesture based transitions with react navigation? - react-native

I've tried searching everywhere but the only thing I can find that is remotely similar to what I want to do is the PanResponder. However, with PanResponder I will have to make custom headers which I am not sure is the right way of doing this.
To be specific, I want to add the ability for the user to swipe to transition to a new screen/route in a Stack Navigator.
If it can't be done, then I'd like to know if making a custom header is ok?
Thanks a lot!

Related

Is there a way to overlay react-navigation headers from within a screen?

Wondering if there's a simple way to overlay react-navigation's Stack and MaterialTopTabNavigator components within individual screens. I need to overlay both when displaying components such as loading overlays and dialog/prompt components.
I understand I could define these components within the same root file as the navigation, however this means I have to track the state of the dialog within redux or some other shared state, which I would prefer to avoid in an effort to be more declarative/functional.
Can't find any good solutions, and I'm combing through react-navigation's source code, but if someone else has already solved this it would save me a lot of time. Thanks!
Edit: I also don't want to use react-native's modal or react-native-modal. Would like to implement a custom component myself.

How can you make a movable frame over the content with React Native, while making it possible to click the content around it?

I'm looking for a solution, if possible a library or a custom component, for React Native, without Expo.
I need to create a video frame that is movable in the screen, up and down, and cover the content. I also need to make it possible to click on the content behind it.
Another difficulty is that I need it to stay up on all screens during navigation.
I first tried to use reanimated-bottom-sheet with some increments, but the content behind the bottom is not clickable. Also, to make it available on all screens I needed to put in at the same level as React Navigation's BottomTabNavigator and it covers the tab bar too even with a zIndex.
I also tried to use modals, but I'm relatively new to React Native and couldn't find how to make the background touchable as well as making it movable.
I guess I need to make a view with absolute positionning and learn Reanimated, unless you have a simpler idea?
Thanks

How do I integrate react-navigation with an existing tab view component

I would like to use React Navigation with a tab view component that is not its default tab view (the one I have chosen to use is react-native-tab-view, as it provides a much more comprehensive interface for customization of its appearance). However, I just don't seem to be able to understand the documentation for writing custom navigators and routers. What are the basic steps I will need to perform this integration? How is this going to be affected by the fact that I will need to be able to compose a StackNavigator inside of some of my tab view's tabs?
As pointed out by #MarsonMao in the comments, the default implementation is based on react-native-tab-view. Unfortunately, it didn't provide the hooks I needed to make it work, but I was able to make a subclass of TabBarTop with a copy of the original render function modified to include the change I needed.

REACT NATIVE: Modal temporary closes (flickers) when app is minimized by Menu Button

Using the react native's official Modal component
Is there any way to prevent the behavior when the modal is open, if i press the menu button of the mobile (built-in one) the modal flickers and closes temporary exposing the background view. Please see the attached url of the GIF for clarification . I am also not sure whether its a default behavior in react native or not.
https://imgur.com/LeTtNj5
Thanks in advance
This isn't so much a solution as much as it's guidance. You haven't really given enough detail to help you out properly. Best if you can share the code or setup a reduced test case at https://snack.expo.io that we can fiddle with.
That said, I'm not totally sure. This is an interesting problem, and I'm curious if you'll find a possible solution and it may depend on your implementation details. For instance, is the modal part of the navigation stack (react-navigation?) or is it an imported component? Either way, I would begin by playing with componentWillUnmount. Does it get called? If so, perhaps you can insert some black magic there to minimize the effect, but you'd first need to isolate what specifically is going on before you can hope to solve it.

Slide-out vertical nav in UIExplorer example?

I'm interested in using a slide-out vertical navigation in an app using react-native. Is there a trick to this, or is it just a matter of creating a View and adding CSS that makes it respond to a button-tap or a swipe motion?
I've gone through the UIExplorer example in the Github repo, and did not see this style of navigation within it. I am new to react (and react-native, of course). I'm not having trouble with the tutorials I've gone through, just curious if there's a "React Way" to do this, or if I ought to just hack along until I get something working. Thanks.
I work on the <Navigator> component for React Native, and I think it might fit your needs.
Check out the documentation here: http://facebook.github.io/react-native/docs/navigator.html
And the example code in UIExplorer: https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/Navigator/NavigatorExample.js
The navigator is still a work in progress, so feedback is welcome! (you can file an issue on Github and tag me, #ericvicenti)