Skip to content

AsyncConstructor needs to be exported #233

Closed
@nealeu

Description

@nealeu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions