-
-
Save faustoct1/224de444788e4292f570f8508709e3ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { FlatList, View, Text } from 'react-native'; | |
class List extends Component { | |
/* | |
essa abordagem ajuda carregar componentes mais rapido de forma async ao msm tempo q List inicializa :) | |
*/ | |
initAsync = async () => { | |
} | |
constructor(props) { | |
super(props) | |
this.initAsync() | |
} | |
componentWillUnmount = async () => { | |
} | |
componentDidMount = async () => { | |
} | |
render = () => { | |
return ( | |
<View style={flex:1,height:'100%'}> | |
<FlatList | |
keyExtractor={(item, index) => index} | |
data={[1,2,3,4,5]} | |
renderItem={({item,index}) => <View><Text>{item}</Text></View>} | |
}} /> | |
</View> | |
) | |
} | |
} | |
}); | |
export default List; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment