soundcloud-api-ts-next
    Preparing search index...

    Function useTrackLikes

    • Fetch users who liked a SoundCloud track.

      Parameters

      • trackId: string | number | undefined

        The track ID. Pass undefined to skip the request.

      Returns HookResult<SoundCloudUser[]>

      Hook result with data as an array of SoundCloudUser who liked the track.

      import { useTrackLikes } from "soundcloud-api-ts-next";

      function Likers({ trackId }: { trackId: number }) {
      const { data: users, loading } = useTrackLikes(trackId);
      if (loading) return <p>Loading...</p>;
      return <ul>{users?.map(u => <li key={u.id}>{u.username}</li>)}</ul>;
      }