I would like to have a parent component wrapping the screens so I can pass global styles to those components like instead of repeating same global styles in each component. However, Navigator doesn't accept View or anything with styles inside it.
return (
<NavigationContainer>
<Navigator>
{isAuthenticated ? (
<>
<Screen options={{headerShown: false}} name={'TabsNavigation'} component={BottomTabsNavigator}/>
<Screen options={{headerShown: false}} name={'Home'} component={Home}/>
</>
) : (
<>
<Screen options={{headerShown: false}} name={'Login'} component={Login}/>
<Screen options={{headerShown: false}} name={'Register'} component={Register}/>
</>
)}
</Navigator>
</NavigationContainer>
);
How can I achieve this?
EDIT
All my components start like this:
<SafeAreaView style={styles(theme).flex}>
<ScrollView contentInsetAdjustmentBehavior="automatic">
<View>
<Text>Content here</Text>
</View>
</ScrollView>
</SafeAreaView>
So instead I want to make it so all my components start like this:
<View>
<Text>Content here</Text>
</View>
I want to move SafeAreaView and ScrollView to a parent component