Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object {
- "44": Object {
- "pro_id": "44",
- "pro_img": "url",
- "pro_name": " S4 ",
- },
- "52": Object {
- "pro_id": "52",
- "pro_img": "url",
- "pro_name": " S4 ",
- },
- }
- retrieveData = async () => {
- try {
- await AsyncStorage.getItem('userFavorites') .then(req => JSON.parse(req))
- .then(json =>
- this.setState({
- favPro:json
- })
- )
- } catch (error) {
- } }
- fav = ({ item }) => {
- return (
- <View>
- <Text>{item.pro_id+ item.pro_name}</Text>
- </View>
- )
- }
- <FlatList
- data={this.state.favPro}
- renderItem={this.fav}
- keyExtractor={item => item.pro_id}
- />
Add Comment
Please, Sign In to add comment