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

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.

Related

Can a custom header in react-navigation receive the scrollview ref in a createStackNavigator without creating a context and custom wrappers?

I am trying to see if I can emulate the iOS header in a cross platform without using native-navigator
However, I can't seem to find a way of doing the following using the standard custom Header API
detecting that the entire screen content is in a ScrollView or Hoc'ed scroll view (which is done by headerLargeTitle
passing up the scroll view ref which allows the header animation to determine where it is in the sequence to scroll.
What I've done before was to have a context that is used by the Header and tracks the scrollviewref by having a HoC that pushes up the value into the context. Though that works it looks pretty clunky.
I am thinking that for me to implement this cleanly I need to be able to get the ScrollView ref and animate the height of the view as needed.
What I am thinking is it needs a custom navigator altogether to get this to work and the existing createStackNavigator will not be able to handle this case too well.

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 I replace Context Api and redux in wix/react-native-navigation

We use wix/react-native-navigation and tried to use Context API from react.We need all the screenshots to receive data and when changing in one place, there is a change in all places.The api context is not suitable, it makes a context for each screen, that is, when changed in 1 screen, the data will not be rerender in another. I would also not like to use Redux since editors are not signed in all screenshots, and it’s too difficult to forward props.
Does anyone have any ideas how to solve this problem?
This seems to be a case for the model view controller pattern.
Each screen would be a view in this pattern. You need to trigger a rerender when the data changes. You can define functions in the react context (model) and then reference it in your lifecycle methods (controller) of your different views.

How can I create gesture based transitions with react navigation?

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!

React Native Navigation Problems

I am new to React Native and want to be able to make my code where the user clicks on text and it takes them from an initial page and am very confused as to how I am supposed to do this and where to put what. Am I supposed to have separate files for separate pages? Thanks!
The Navigator or NavigatorIOS components are what you're looking for. Basically, your text elements need to be wrapped in an element like TouchableHighlight that has an onPress handler that utilizes the navigator.push() to navigate. Or you could jThis tutorial does a pretty good job describing how Navigation works on a basic level within React Native apps.
As to separate files for separate pages - it's not necessary, but as you develop your own custom components and your apps become more complicated, having them in separate files helps with keeping you