mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 06:49:40 +02:00
13 lines
318 B
TypeScript
13 lines
318 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
export const InputContext = createContext<boolean | null>(null);
|
|
|
|
export function useInputContext() {
|
|
const value = useContext(InputContext);
|
|
|
|
if (value === null) {
|
|
throw new Error('useContext must be used within a Context.Provider');
|
|
}
|
|
|
|
return value;
|
|
}
|