Skip to content

Commit d78a369

Browse files
committed
avoid throwing in case no hypergraph space provider exists
1 parent cde0fa2 commit d78a369

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/hypergraph-react/src/HypergraphSpaceContext.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ import {
1515
} from 'react';
1616
import { useHypergraphApp } from './HypergraphAppContext.js';
1717

18+
// TODO space can be undefined
1819
export type HypergraphContext = { space: string };
1920

2021
export const HypergraphReactContext = createContext<HypergraphContext | undefined>(undefined);
2122

2223
export function useHypergraphSpaceInternal() {
2324
const context = useContext(HypergraphReactContext);
24-
if (!context) {
25-
throw new Error('useHypergraphSpace must be used within a HypergraphSpaceProvider');
26-
}
27-
2825
return context as HypergraphContext;
2926
}
3027

0 commit comments

Comments
 (0)