Hello I have this message alert:
from calling this component like this:
<SettingButton screeName={'Session}/>
I'm learning typescript, and I have no idea what I'm doing wrong. Here is my component:
import { NativeStackNavigationProp } from '@react-navigation/native-stack';type StackParamList = { Home: undefined; Session: { time: SliderOption; intensity: SliderOption; }; Logs: undefined; Setting: undefined; Splash: undefined; Subscription: undefined; BreathRoom: undefined;};type navigationProps = NativeStackNavigationProp<StackParamList>;const SettingButton = (screenName: keyof StackParamList) => { const { navigate } = useNavigation<navigationProps>() return (<View><TouchableOpacity onPress={() => navigate(screenName)}><CogsComponent width={30} height={30} /></TouchableOpacity></View> )}export default SettingButton;
I expect it to render the component. but I don't know where I am making the mistake.