Does this work nicely with TypeScript?
elie222 opened this issue · comments
Elie Steinbock commented
Does this work nicely with TypeScript?
Mike Frawley commented
No, there aren't type definitions currently.
I added this to a 3rd-party-types.d.ts
file just to compile under strict mode, but it could surely be improved 🤠
declare module 'with-context' {
export var withContext: any;
}
Elie Steinbock commented
Thanks. Here's one better, but still not too useful yet:
declare module 'with-context' {
export function withContext(ctx: React.Context, label?: string): (component: any) => any
}
Or even:
declare module 'with-context' {
export function withContext(ctx: React.Context, label?: string): (WrappedComp: React.ComponentClass<P> | React.FC<P>) => any
}
But wasn't able to figure out replacing the last any
with something better yet...