Liichi / CocktailFinder

0 stars 0 forks source link

Props destructuring #5

Closed IanCiarulli closed 4 years ago

IanCiarulli commented 4 years ago

https://github.com/Liichi/CocktailFinder/blob/c68fe20764f880d2de5694162be56d30b6c6af5c/src/screens/search.tsx#L47

Destructurar las props

Liichi commented 4 years ago

trendria que hacer un array para cada variable de la estructura?

IanCiarulli commented 4 years ago

No,lo que vos le pasas a la flatlist es un objeto, tenes que destructurar ese objeto, const { data } = this.props , entonces le pasas data={data}

Liichi commented 4 years ago

Ahh ya entendi, gracias!

Liichi commented 4 years ago

Arreglado