diff --git a/front/components/SearchResult.tsx b/front/components/SearchResult.tsx index d682e8b..46dab02 100644 --- a/front/components/SearchResult.tsx +++ b/front/components/SearchResult.tsx @@ -85,11 +85,6 @@ const SongsSearchComponent = (props: SongsSearchComponentProps) => { const navigation = useNavigation(); const { songData } = React.useContext(SearchContext); const favoritesQuery = useQuery(API.getLikedSongs(['artist'])); - - const handleFavoriteButton = async (state: boolean, songId: number): Promise => { - if (state == false) await API.removeLikedSong(songId); - else await API.addLikedSong(songId); - }; const { mutate } = useLikeSongMutation(); return ( diff --git a/front/components/UI/MusicList.tsx b/front/components/UI/MusicList.tsx index fbd80c4..6af7f01 100644 --- a/front/components/UI/MusicList.tsx +++ b/front/components/UI/MusicList.tsx @@ -236,6 +236,10 @@ const styles = StyleSheet.create({ // Using `memo` to optimize rendering performance by memorizing the component's output. // This ensures that the component only re-renders when its props change. -const MusicList = memo(MusicListComponent); +const MusicList = memo(MusicListComponent, (prev, next) => { + console.log('AAAAA'); + console.log(prev.initialMusics, next.initialMusics); + return prev.initialMusics.length == next.initialMusics.length; +}); export default MusicList; diff --git a/front/components/V2/SongCardInfo.tsx b/front/components/V2/SongCardInfo.tsx index 68e7c0f..720e3ac 100644 --- a/front/components/V2/SongCardInfo.tsx +++ b/front/components/V2/SongCardInfo.tsx @@ -2,13 +2,7 @@ import Song from '../../models/Song'; import React from 'react'; import { LikeButton } from './SongCardInfoLikeBtn'; import { Image, Platform, View } from 'react-native'; -import { - Pressable, - Text, - PresenceTransition, - Icon, - useBreakpointValue, -} from 'native-base'; +import { Pressable, Text, PresenceTransition, Icon, useBreakpointValue } from 'native-base'; import { Ionicons } from '@expo/vector-icons'; import { useQuery } from '../../Queries'; import API from '../../API';