Hide route in React Navigation v5 - react-native

Is there a way to hide a route in the drawer but still be able to navigate to it?
Example: I want get rid of Post in the drawer but I want be able to navigate to a <Post> component.

There are 2 options:
Put the Post screen inside a stack with another screen and use that stack nested in drawer.
Use a custom component for drawer to manually specify which items to show: https://reactnavigation.org/docs/en/next/drawer-navigator.html#drawercontent

Related

How to pass params to stack navigator from screen

Is it possible to pass params from a React component or React Native screen to a react native screen navigator within a stack navigation.
The reason I would like to achieve this is the screen navigator has a button in it that needs to be passed a function.
So to be clear, I am using useState in a screen to save some values I am getting from a form. I would like to pass these values to the stack navigator so they can be used in a function that makes a call to an api.
Please note this question is not about passing params from screen to screen with React Navigation, I know how to achieve this using route params.
I suggest that if you hide the stack header & create your own header in the screen component, you can get all the parameters from params

How to add bottom tab navigator to one screen inside stack navigation?

I'm making an app, and in the app there is a home screen. On the home screen, I want to add a bottom navigator with various logos, which when clicked on, navigate the user to a different screen. I only want the bottom navigator to be on the screens that can be accessed from the bottom navigator in home. How would I do this? Would I need different types of navigators in my app.js since I'm using a stack navigator as well? Thanks for any help, I sincerely appreciate it.
Use tab-based-navigation provided by react-navigation. Make tab navigator with the screens that you want to be displayed with tab and wrap that in Stack. Any other screen that you want to display without tab navigation, just add as another stack and wrap all the stacks in Stack.Navigator. Here's the docs they are pretty well explained
https://reactnavigation.org/docs/tab-based-navigation

how to show a modal and be able to navigate between screens

I am using react navigation and would like to show the modal that will be visible above the screen and be able to navigate to the next screens in StackNavigator. The illustration below shows what I want to achieve
The solution that is in the documentation (https://reactnavigation.org/docs/modal/) solves only part of the problem, because I can't open a modal and navigate another part of the stack while keeping the modal on top
you can use react native modal . it is not part of react navigation and it will show above all screens

I have faced problem in Stack Navigator in react-native

Suppose I have 4 tab screens. The tab is created with a custom footer component with layout concept and all the navigational screens are listed in the stack navigator route section and used goBack() method to navigate the previous screen. now For a situation, my navigation route as follows started with
Home->Testimonial->offerings, then again from offerings->Testimonial->about here I stopped in this screen then pressed the back button with goBack() function. but this time goBack() routes me to
about->testimonial->offerings->home. Like the unique screens are listed in stack navigators routes, not the duplicate screens.
I want to know is it an issue? if yes, then how can I manage it?
Use a unique key for your screen.
https://reactnavigation.org/docs/navigation-actions/
navigation.navigate({
name: 'offerings',
key: 'offerings' + someUniqueId,
})

How to use react native navigation to create a nested navigation? (Example: Stack navigator inside a Tab navigator)

I'm trying to create a nested navigation as shown in the image below. I need to have a main TabNavigator and then inside one tab page, I need to add a StackNavigator to enable navigation to that tab page's sub pages. How can I do this?
Here's an illustration of what I need to do:
Please check my repository ,I have created a sample app of your scenario.
Type 1
https://github.com/paraswatts/StackNavigator-inside-TabNavigator
Type 2
https://github.com/paraswatts/ParasWatts