File size: 315 Bytes
c69ce84
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import { useContext } from 'react';
import { FilterContext } from '../contexts/FilterContext';

export const useFilterContext = () => {
  const context = useContext(FilterContext);
  if (context === undefined) {
    throw new Error('useFilterContext must be used within a FilterProvider');
  }
  return context;
};