The
title
and
header
properties for
StackNavigationOptions
allow for arbitrary strings as the title prop but I wanted to pass a translation key for the title and localise the text within the
header
component. I generate a union type of translation key strings based on the translations I have and wanted to restrict the
title
of navigation screens to be this union type.
I was able to patch @react-navigation/stack and @react-navigation/elements to satisfying my needs for react-navigation v6 but now I have to repatch react-navigation v7 and also manually edit files in the
lib
directory, not just the source code, so that typescript accesses the modified types for my application.
Is this something that react-navigation could support in the future or is there a better way to handle my use case?
Thank you for your considerations.