quick fixes
This commit is contained in:
@@ -2,13 +2,8 @@ import { useContext } from 'react';
|
||||
import { SpotifyContext } from '@/contexts/spotify-context';
|
||||
import type { SpotifyContextType } from './types';
|
||||
|
||||
export const useSpotify = (): SpotifyContextType => {
|
||||
export const useSpotify = (): SpotifyContextType | null => {
|
||||
const context = useContext(SpotifyContext);
|
||||
|
||||
if (!context) {
|
||||
throw new Error('useSpotify must be used within a SpotifyProvider');
|
||||
}
|
||||
|
||||
return context;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user