File size: 339 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import { useContext } from 'react';
import { invariant } from '../lib/invariant';
import { IndexContext } from './IndexContext';
export function useIndexContext() {
const context = useContext(IndexContext);
invariant(
context !== null,
'The <Index> component must be used within <InstantSearch>.'
);
return context;
}
|