import { createContext, ReactNode, useContext } from 'react'; export function createIndependentContext() { const Context = createContext({} as ContextValue); const useIndependentContext = () => { return useContext(Context); }; const Provider = ({ children, value }: { value: ContextValue; children: ReactNode }) => ( {children} ); return [Provider, useIndependentContext] as const; }