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

FlatList Typescript error missing return type on function

$
0
0

Im trying to use a interface on the renderItem={({ item }) from flatlist, but whenever i try im getting the same error.

"Missing return type on function. eslint(@typescript-eslint/explicit-function-return-type)"

How can i type that?

  export function Notifications(): JSX.Element {interface INotificationsProps {  id: number;  title: string;  description: string;  link: string;}interface INotificationsObject {  event: INotificationsProps[];}      let datas: INotificationsObject = {        event: [          {            id: 1,            title: 'Missa de Santo Antônio',            description:'Si osculantur puorhuus aut unexem tuam osculun, non dico qued omnia quan sunt hominiset sic non tangebur, si aut ex eis meriatur.',            link: 'www.google.com.br',          },          {            id: 2,            title: 'Bazar Beneficente',            description:'Si osculantur puorhuus aut unexem tuam osculun, non dico qued omnia quan sunt hominiset sic non tangebur, si aut ex eis meriatur.',            link: 'www.google.com.br',          },        ],      };      return (<Fragment><FlatList            data={datas.event}            renderItem={({ item }) => (<ContainerNotifications><TitleNotification>{item.title}</TitleNotification><DescriptionNotification>                  {item.description}</DescriptionNotification><SeeMore>Ver mais</SeeMore></ContainerNotifications>            )}          /></Fragment>      );    }

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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