remove todo + clarify error message

Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Emma Indal
2022-04-14 13:54:14 +02:00
parent fbe4918bbf
commit 20a3d62a7a
2 changed files with 3 additions and 11 deletions
@@ -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;
};
+1 -5
View File
@@ -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,