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

why generic type arrow function shows error?

$
0
0

Why this is not working ?

const List: <ListItem> = ({ items, render }: {  items: ListItem[],  render: (item: ListItem) => React.ReactNode}) => {  return (<View>      { items.map((el, i) => (<Text key={i}>{render(el)}</Text>      )) }</View>  )};

Error:

TransformError SyntaxError: C:\RNT\TS\ts\App.tsx: Unexpected token, expected "(" (54:23)

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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