Change useApiHolder to not throw when outside API context

Instead of throwing a NotImplementedError, useApiHolder now returns an
empty ApiHolder when no API context is available in the React tree.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-05 10:18:26 +01:00
parent d0b53e39fd
commit fe848e09e6
3 changed files with 33 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/frontend-plugin-api': patch
---
Changed `useApiHolder` to return an empty `ApiHolder` instead of throwing when used outside of an API context.