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

TypeError: Invalid attempt to destructure non-iterable instance. On React Native

$
0
0

I am getting an error because of this line const [guesses, setGuesses] = React.useState < IGuess > defaultGuess;On Vscode it shows Operator '>' cannot be applied to types 'boolean' and 'IGuess'.ts(2365)

****interface IGuess {  [key: number]: string;}const defaultGuess: IGuess = {  0: '',  1: '',  2: '',  3: '',  4: '',  5: '',};export default function App() {  const [guesses, setGuesses] = React.useState < IGuess > defaultGuess;*****

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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