how to solve error 'undefined is not an object evaluating navigation.navigate' in react navigation 6 ?
const CategoryContainer = ({ setSelectedItem, navigation,}: { setSelectedItem: Function; navigation: any;}) => { return (<TouchableOpacity onPress={() => navigation.navigate('Filter')}><Image style={Layout.icon} source={Images.ic_filter} resizeMode={'contain'} /></TouchableOpacity> )})