From 2b8c986ce0a84c4cfc33001d318a97dfc714874b Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 4 Mar 2022 14:06:34 +0100 Subject: [PATCH] catalog-react: Remove useEntityListProvider Signed-off-by: Johan Haals --- .changeset/quiet-pens-wait.md | 5 +++++ plugins/catalog-react/api-report.md | 5 ----- plugins/catalog-react/src/hooks/index.ts | 1 - .../src/hooks/useEntityListProvider.tsx | 14 -------------- 4 files changed, 5 insertions(+), 20 deletions(-) create mode 100644 .changeset/quiet-pens-wait.md diff --git a/.changeset/quiet-pens-wait.md b/.changeset/quiet-pens-wait.md new file mode 100644 index 0000000000..b7510eab3f --- /dev/null +++ b/.changeset/quiet-pens-wait.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': minor +--- + +**BREAKING**: Removed `useEntityListProvider` use `useEntityList` instead. diff --git a/plugins/catalog-react/api-report.md b/plugins/catalog-react/api-report.md index ca5de26048..ceedf9fe1a 100644 --- a/plugins/catalog-react/api-report.md +++ b/plugins/catalog-react/api-report.md @@ -544,11 +544,6 @@ export function useEntityList< EntityFilters extends DefaultEntityFilters = DefaultEntityFilters, >(): EntityListContextProps; -// @public @deprecated -export function useEntityListProvider< - EntityFilters extends DefaultEntityFilters = DefaultEntityFilters, ->(): EntityListContextProps; - // @public export function useEntityOwnership(): { loading: boolean; diff --git a/plugins/catalog-react/src/hooks/index.ts b/plugins/catalog-react/src/hooks/index.ts index da23d54ad7..9b4955fc91 100644 --- a/plugins/catalog-react/src/hooks/index.ts +++ b/plugins/catalog-react/src/hooks/index.ts @@ -29,7 +29,6 @@ export { useEntityCompoundName } from './useEntityCompoundName'; export { EntityListContext, EntityListProvider, - useEntityListProvider, useEntityList, } from './useEntityListProvider'; export type { diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index 72dfb7d1c3..ccac475ae8 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -249,20 +249,6 @@ export const EntityListProvider = ({ ); }; -/** - * Hook for interacting with the entity list context provided by the {@link EntityListProvider}. - * @public - * @deprecated use {@link useEntityList} instead. - */ -export function useEntityListProvider< - EntityFilters extends DefaultEntityFilters = DefaultEntityFilters, ->(): EntityListContextProps { - const context = useContext(EntityListContext); - if (!context) - throw new Error('useEntityList must be used within EntityListProvider'); - return context; -} - /** * Hook for interacting with the entity list context provided by the {@link EntityListProvider}. * @public