is there a better way to do this :
{ !AuthState && (
<NativeStackNavigator.Screen name="Auth" component={Auth} options={{headerShown: false}} />)
}
{ !AuthState && (
<NativeStackNavigator.Screen name="XXX" component={XXX} options={{headerShown: false}} />)
}
{ !AuthState && (
<NativeStackNavigator.Screen name="XXX" component={XXX} options={{headerShown: false}} />)
}
thanks for your answer!
CodePudding user response:
You can just use the conditional for all screens once.
{
!AuthState && (
<>
<NativeStackNavigator.Screen name="Auth" component={Auth} options={{headerShown: false}} />
<NativeStackNavigator.Screen name="XXX" component={XXX} options={{headerShown: false}} />
<NativeStackNavigator.Screen name="XXX" component={XXX} options={{headerShown: false}} />
</>
)
}