import React, { Context } from 'react'; export function withContext(Component: T, Ctx: Context, prop: string): T { function WithContext(props: {}) { const context = React.useContext(Ctx); // @ts-ignore return ; } return WithContext as unknown as T; }