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

TS7006: Parameter "__"' implicitly has an 'any' type. I'm unable to understand the error & solution below

$
0
0

At fist my code looked like this this

  const customerInputHandler = (currentCustomer) => {    setCustomer(currentCustomer.nativeEvent.text);  };

And after searching the internet I came on a solution and I implemented this code below.I've being searching around to try and understand this code but unable to.Could some please explain the error I had above & explain why this solution fixed everything

const customerInputHandler = (currentCustomer: {     nativeEvent: {text: React.SetStateAction<string>};  }) => {    setCustomer(currentCustomer.nativeEvent.text);};

Viewing all articles
Browse latest Browse all 6213

Trending Articles



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