Type props custom header react-navigation

37 views Asked by At

I created a custom header and the title of this header was extracted from the navigation parameters, however typescript tells me that the property that I passed through the navigation parameters does not exist, could you help me type the header properties or how can I fix this error.

enter image description here

I tried typing the props directly but I get another more complex error.

these are types for my HomeNavigator

export type HomeNavigatorTypes = {
  Home: undefined
  Cart: undefined
  SearchBusiness: undefined
  Delivery: undefined
  CreateAddress: undefined
  BusinessCategory: { category: BusinessCategories }
  Business: undefined
  SearchBusinessItems: undefined
}

.....

const HomeNavigator = createNativeStackNavigator<HomeNavigatorTypes>(); 
0

There are 0 answers