mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-14 14:25:40 -05:00
11 lines
353 B
TypeScript
11 lines
353 B
TypeScript
import { createContext, useContext } from 'react';
|
|
import { assert } from 'tsafe';
|
|
|
|
export const RefImageIdContext = createContext<string | null>(null);
|
|
|
|
export const useRefImageIdContext = (): string => {
|
|
const id = useContext(RefImageIdContext);
|
|
assert(id, 'useRefImageIdContext must be used within a RefImageIdContext.Provider');
|
|
return id;
|
|
};
|