mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-12 03:07:05 +00:00
16 lines
440 B
TypeScript
16 lines
440 B
TypeScript
import { useContext } from 'react';
|
|
|
|
import EntityRegistryV2 from '@app/entityV2/EntityRegistry';
|
|
import { EntityRegistryContext } from '@src/entityRegistryContext';
|
|
|
|
/**
|
|
* Fetch an instance of EntityRegistry from the React context.
|
|
*/
|
|
export function useEntityRegistry() {
|
|
return useContext(EntityRegistryContext);
|
|
}
|
|
|
|
export function useEntityRegistryV2() {
|
|
return useContext(EntityRegistryContext) as any as EntityRegistryV2;
|
|
}
|