import { createContext, PropsWithChildren, useContext } from 'react'; export function createRowContext() { const Context = createContext(null); Context.displayName = 'RowContext'; return { RowProvider, useRowContext }; function RowProvider({ children, context, }: PropsWithChildren<{ context: TContext }>) { return {children}; } function useRowContext() { const context = useContext(Context); if (!context) { throw new Error('should be nested under RowProvider'); } return context; } }