@cobuildlab/8base-chat
Version:
Chat component that uses 8base
9 lines (8 loc) • 636 B
TypeScript
import hoistNonReactStatics from 'hoist-non-react-statics';
import React, { Context } from 'react';
interface IWithContextOpts<TContext> {
context: Context<TContext>;
keys?: Array<keyof TContext>;
}
declare function withContext<TProps extends Partial<TContext>, TContext extends {}, TComponent extends React.ComponentType<TProps> = React.ComponentType<TProps>>({ context, keys }: IWithContextOpts<TContext>): (Component: TComponent) => ((props: Pick<TProps, import("utility-types").SetDifference<keyof TProps, keyof TContext>>) => JSX.Element) & hoistNonReactStatics.NonReactStatics<TComponent, {}>;
export default withContext;