Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Typescript #24

Open
raymondsze opened this issue Aug 22, 2018 · 2 comments
Open

Problem with Typescript #24

raymondsze opened this issue Aug 22, 2018 · 2 comments

Comments

@raymondsze
Copy link

The output of index.d.ts.
The import React from 'react'; should be import * as React from 'react', as React module does not export default module.
We should not assume user enabled the allowSyntheticDefaultImports setting in ts-config.
Thanks.

/// <reference types="react" />
import React from 'react';
import { ReactElement } from 'react';
export declare type ChildrenFn<P> = (props: P) => JSX.Element | null;
export declare type RPC<RP, P = {}> = React.ComponentType<P & {
    children?: ChildrenFn<RP>;
    render?: ChildrenFn<RP>;
}>;
export declare type MapperComponent<RP, P> = React.ComponentType<RP & P & {
    render?: ChildrenFn<any>;
}>;
export declare type MapperValue<RP, P> = ReactElement<any> | MapperComponent<RP, P>;
export declare type Mapper<RP, P> = Record<string, MapperValue<RP, P>>;
export declare type MapProps<RP> = (props: any) => RP;
export declare function adopt<RP = any, P = any>(mapper: Mapper<RP, P>, mapProps?: MapProps<RP>): RPC<RP, P>;
export declare type AdoptProps<RP, P> = P & {
    mapper: Mapper<RP, P>;
    children?: ChildrenFn<RP>;
    render?: ChildrenFn<RP>;
    mapProps?: MapProps<RP>;
};
export declare class Adopt extends React.Component<AdoptProps<any, any>> {
    private Composed;
    constructor(props: any);
    render(): JSX.Element;
}
@fattenap
Copy link

fattenap commented Feb 20, 2019

It does not look like the changes made to index.tsx, for version 0.6.0, 9 months ago did not make it to npm

@raymondsze
Copy link
Author

seems the owner doesn't actively maintain this module. React hook is released and I haven't use react-adopt at this moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants