TanStackT
TanStack15mo ago
38 replies
conventional-black

useEffect not triggered when data change

I have this :
  const { data: playlistItems } = usePlaylistItems(playlist?.id);
  const { data: isAllowedToEdit } = usePlaylistIsAllowedToEdit(playlist?.id);
  console.log('in table playlist items', playlistItems);
  React.useEffect(() => {
    console.log('new playlist items', playlistItems);
  }, [playlistItems]);

When my playlistItems change I can see the first console.log but the one in useEffect isnt triggered.. why ? I check that because I have a react table showing playlistItems but the table isnt updated when fresh data arrived...
Thx for your help !
Was this page helpful?