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

    Function useRelatedTracks

    • Fetch tracks related to a given SoundCloud track (recommendations).

      Parameters

      • trackId: string | number | undefined

        The track ID to find related tracks for. Pass undefined to skip.

      Returns HookResult<SoundCloudTrack[]>

      Hook result with data as an array of related SoundCloudTrack.

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

      function Related({ trackId }: { trackId: number }) {
      const { data: tracks } = useRelatedTracks(trackId);
      return <ul>{tracks?.map(t => <li key={t.id}>{t.title}</li>)}</ul>;
      }