Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6290

IntrinsicAttributes props in React Native Typescript component

$
0
0

Hello I have this message alert:

enter image description here

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.


Viewing all articles
Browse latest Browse all 6290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>