AsyncConstructor needs to be exported
nealeu opened this issue · comments
Neale Upstone commented
Typescript emits TS4023 error because it cannot find the 'shape' of the function when emitting type declarations. Exporting AsyncConstructor solves this.
For example when I write:
import {createInstance} from "react-async";
export const AsyncData = createInstance<MyData>({});
Typescript wants to generate:
export declare const AsyncData: import("react-async").AsyncConstructor<MyData>;
However this is not possible because AsyncConstructor is not exported