Use constants for screen names
Always use constants for screen names instead of using hard-coded values. For
example, here for each Stack.Screen
we have their names defined in a constant
screenNames
.
Setting tab bar icons
Custom Bottom Tab Icons can be added from the BottomTab.Navigator
instead of
each BottomTab.Screen
to avoid code duplication.
For example, here we have assigned an Icon
to every BottomTab.Screen
individually.
But here, we create an object with the Icon
labels and assign them to the
screens based on the route.name
from the BottomTab.Navigator
itself.