From 20a3d62a7ae28664730d600a6b85274f47e70ab2 Mon Sep 17 00:00:00 2001 From: Emma Indal Date: Thu, 14 Apr 2022 13:54:14 +0200 Subject: [PATCH] remove todo + clarify error message Signed-off-by: Emma Indal --- plugins/search-react/src/context/SearchContext.tsx | 8 ++------ plugins/search-react/src/context/index.tsx | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/plugins/search-react/src/context/SearchContext.tsx b/plugins/search-react/src/context/SearchContext.tsx index 7da4785fdd..6f8067805c 100644 --- a/plugins/search-react/src/context/SearchContext.tsx +++ b/plugins/search-react/src/context/SearchContext.tsx @@ -53,11 +53,7 @@ export type SearchContextState = { pageCursor?: string; }; -// TODO(@backstage/techdocs-core): stop export this publicly when deprecating the context in @backstage/plugin-techdocs. -/** - * @public - */ -export const SearchContext = createVersionedContext<{ +const SearchContext = createVersionedContext<{ 1: SearchContextValue; }>('search-context'); @@ -72,7 +68,7 @@ export const useSearch = () => { const value = context.atVersion(1); if (!value) { - throw new Error('No context for version 1 found'); + throw new Error('No SearchContext v1 found'); } return value; }; diff --git a/plugins/search-react/src/context/index.tsx b/plugins/search-react/src/context/index.tsx index f2ea486e9d..330da035d6 100644 --- a/plugins/search-react/src/context/index.tsx +++ b/plugins/search-react/src/context/index.tsx @@ -14,11 +14,7 @@ * limitations under the License. */ -export { - SearchContextProvider, - SearchContext, - useSearch, -} from './SearchContext'; +export { SearchContextProvider, useSearch } from './SearchContext'; export type { SearchContextState } from './SearchContext'; export { SearchContextProvider as SearchContextProviderForStorybook,