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

React Native Typescript : how to resolve an error of type of parameter for a variable

$
0
0

I'm doing a project in react native (typescript) and here is my issue : I have this error Argument of type 'GestureResponderEvent' is not assignable to parameter of type 'SetStateAction<string>'.ts(2345) with this part of my code, at the i of setSelected :

<View style={{}}><Text style={styles.texteti}>Heading, paragraphe, lien</Text>          {state.map((i) => (<TouchableOpacity onPress={(i) => setSelected(i)}> <Text>{i} Here</Text></TouchableOpacity>          ))}          {selected == "v1Visible" && (<View><Text>View 1</Text></View>          )}          {selected == "v2Visible" && (<View><Text>View 2</Text></View>          )}          {selected == "v3Visible" && (<View><Text>View 3</Text></View>          )}          {selected == "v4Visible" && (<View><Text>View 4</Text></View>          )}</View>

Anyone has an idea of how to resolve this


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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