Comments (8)
As edited above,
Since the stack navigator is nested inside the bottom navigator, you get navigation
, route
objects as props in the stack navigator.
from react-native-curved-bottom-bar.
same here ...
from react-native-curved-bottom-bar.
same here ..
from react-native-curved-bottom-bar.
This can be done as below:
- Create a
tabBarRef
for your bottom navigator:
export const tabBarRef = createRef()
- Add it to your bottom navigator:
<CurvedBottomBar.Navigator
ref={tabBarRef}
...
>
...
</CurvedBottomBar.Navigator>
- In your stack navigator that is nested inside the bottom navigator, import the
tabBarRef
and add auseFocusEffect
that hides the bottom navigator when you are on a route that needs the bottom tab to be hidden. Note that since the stack navigator is nested inside the bottom navigator, you getnavigation
,route
objects as props in the stack navigator.
import { tabBarRef } from 'path-to-bottom-navigator'
import {
getFocusedRouteNameFromRoute,
useFocusEffect,
} from '@react-navigation/native'
useFocusEffect(() => {
const routeName = getFocusedRouteNameFromRoute(route)
if (
[
'route-with-bottom-tab-hidden-1',
'route-with-bottom-tab-hidden-2',
...
].includes(routeName)
) {
tabBarRef.current.setVisible(false)
} else {
tabBarRef.current.setVisible(true)
}
})
from react-native-curved-bottom-bar.
@draturi95 where should I get the route variable from? I did that useFocusEffect inside the definition of the stackNavigator, but couldn't find the route variable.
from react-native-curved-bottom-bar.
Hi you, can you share the bottom menu code to handle this problem?
Thank you.
from react-native-curved-bottom-bar.
can someone explain better that example or have one done
from react-native-curved-bottom-bar.
Why do you have to do this when you can have them on the same hierarchy as this tab navigator?
from react-native-curved-bottom-bar.
Related Issues (20)
- setVisible set to true cant show again the tab bar
- react-native-curved-bottom-bar doesn't seem to be linked.make sure:
- react-native-curved-bottom-bar doesn't seem to be linked.make sure: HOT 7
- Support screen options HOT 7
- Perfomance when wrap bottom bar with Stack.Navigator HOT 8
- Lagging while clicking the tabs HOT 2
- Can we add borderColor and borderWidth to curved tab HOT 6
- Render all tabs at startup/mounting HOT 3
- Bottom padding to <CurvedBottomBar.Navigator /> component style HOT 1
- [Android] Shadow issue on Expo HOT 4
- Work with expo-router
- options={{headerShown: false}} in CurvedBottomBar.Screen is not working HOT 8
- headerShown is false HOT 7
- i am trying to show component when user click on middle circle <Animated.view
- Dynamic changing of icon
- Border Width and Radius issue HOT 1
- custom curves HOT 1
- Navigating to stack with curved bottom bar shows white screen HOT 1
- strokeColor and strokeWidth issue on V3 HOT 1
- Curved Border colour and border width
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-curved-bottom-bar.