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

How do you use "useState" in Typescript?

$
0
0

How do I do something simple like this in Typescript?

const [text, setText] = useState("");

I'm getting a lot of errors, and I don't know how to fix them.

Parameter 'text' implicitly has an 'any' type.ts(7006)Parameter 'setText' implicitly has an 'any' type.ts(7006)'useState', which lacks return-type annotation, implicitly has an 'any' return type.ts(7010)

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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