Skip to content

Commit

Permalink
fix(SongItem): 修复useEffect依赖项,确保dispatch在依赖数组中
Browse files Browse the repository at this point in the history
  • Loading branch information
thoulee21 committed Dec 13, 2024
1 parent e02757f commit d02f14f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/SongItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ export const SongItem = ({
);
await dispatch(clearAddOneAsync(item));
await TrackPlayer.play();
//no dispatch
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [item]);
}, [dispatch, item]);

const renderIndex = useCallback((
props: ListLRProps
Expand Down

0 comments on commit d02f14f

Please sign in to comment.