The user ID. Pass undefined to skip the request.
Hook result with data as an array of SoundCloudPlaylist.
import { useUserPlaylists } from "soundcloud-api-ts-next";
function Playlists({ userId }: { userId: number }) {
const { data: playlists, loading } = useUserPlaylists(userId);
if (loading) return <p>Loading...</p>;
return <ul>{playlists?.map(p => <li key={p.id}>{p.title}</li>)}</ul>;
}
Fetch playlists created by a SoundCloud user.