In the upgrade guide to react-navigation v6:
it states that you can use
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}
somewhere in your code to set the RootParamList globally for all hooks etc.
However, when I try to include the snippet and set my param list all I get is
Duplicate identifier 'RootParamList'.ts(2300)
types.d.ts(5, 19): 'RootParamList' was also declared here
Obviously, the type is already declared and I am trying to overwrite it but this does not seem to be possible.
Any ideas how to overwrite without resulting in a type error?