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

eslint@typescript-eslint/no-unsafe-return throws error message when using inline require() statement

$
0
0

I have a react native typescript project where I am using inline require() statement to import images for example.

<Card.Image source={smallPhoto ? { uri: smallPhoto } : require("../../assets/no-photo.png")} style={styles.cardImage} />

I'm seeing the following message

Unsafe assignment of an `any` value.eslint@typescript-eslint/no-unsafe-assignment

In react native app what would the return type be for a require()

Card.Image is coming from react-native elements. How do I avoid this error message?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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