1

I am using react-navigation v 6.1 for drawer navigation, I am trying to implement the following:

enter image description here

Currently this is what I was able to achieve:

enter image description here

How can I set border radius for the stack or routes that has been navigated by the user?

I tried to set the sceneContainerStyle border radius on screenOptions for <Drawer.Navigator> but seems that there is actually another child view inside the scene view.

0x01Brain
  • 798
  • 2
  • 12
  • 28

1 Answers1

0

After a lot of trials I found a hack since I was using nested navigator it appeared that navigator had a child view which wraps the current screen view, first I set theme for:

import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
import AppGlobalNavigator from './navigation'

const navigatorTheme = {
  ...DefaultTheme,
  colors: {
    ...DefaultTheme.colors,
    background: 'rgba(0, 0, 0, 0)',
  },
};


const App = () => )
 <NavigationContainer theme={navigatorTheme}>
    <AppGlobalNavigator/>
 </NavigationContainer
)

Then I got a transparent screen views, I wrapped each component with view which has backgroundColor set to white color as as set borderRadius before passing them to navigator screen <Stack.Screen>.

Result:

enter image description here

0x01Brain
  • 798
  • 2
  • 12
  • 28