export SearchContext to be able to use in storybook as SearchContextProvider requires searchApiRef

Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Emma Indal
2021-07-09 12:20:04 +02:00
committed by blam
parent 2a9cb61b7c
commit 70fe17ce6c
2 changed files with 8 additions and 2 deletions
@@ -45,7 +45,9 @@ type SettableSearchContext = Omit<
'result' | 'setTerm' | 'setTypes' | 'setFilters' | 'setPageCursor'
>;
const SearchContext = createContext<SearchContextValue | undefined>(undefined);
export const SearchContext = createContext<SearchContextValue | undefined>(
undefined,
);
export const SearchContextProvider = ({
initialState = {
@@ -14,4 +14,8 @@
* limitations under the License.
*/
export { SearchContextProvider, useSearch } from './SearchContext';
export {
SearchContextProvider,
SearchContext,
useSearch,
} from './SearchContext';