You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
992 B

import React from "react";
import {FlatList, ScrollView} from "react-native";
import {useSelector} from 'react-redux';
import {useEffect} from 'react';
import ArtistCard from "./ArtistCard";
const ArtistList = ({navigation, type}) => {
// @ts-ignore
let ARTISTS_LIST = useSelector((state) => state.ReducerArtist.artists);
if(type == "search") {
// @ts-ignore
ARTISTS_LIST = useSelector((state) => state.ReducerArtist.artistsSearch);
}
useEffect(() => {
console.log('ARTISTS_LIST has changed:', ARTISTS_LIST);
}, [ARTISTS_LIST]);
console.log("----")
console.log(ARTISTS_LIST)
return (
<ScrollView>
<FlatList
data={ARTISTS_LIST}
renderItem={({ item }) => (
<ArtistCard navigation={navigation} item={item} />
)}
keyExtractor={(item) => item.name}
/>
</ScrollView>
);
};
export default ArtistList;