How do you implement a custom header component in React Navigation 5?
There is a variable for header, but assigning a component to it doesn't show anything, do you need to assign headerLeft, headerTitle and headerRight for every screen?
<Stack.Screen name="IndexScreen" component={IndexScreen}
options={{
header: () => <HeaderComponent />
}} /> //shows nothing
<Stack.Screen name="IndexScreen" component={IndexScreen}
options={{
headerLeft: () => <HeaderLeftComponent />,
headerTitle: () => <HeaderTitleComponent />,
headerRight: () => <HeaderRightComponent /> // to much repetition
}} />
HeaderComponentlook like, because it's working for me. Creating a snack might also be a good idea, to make it easier to debug.