Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Type problem in 0.7.4 with Typescript 2.4.1 + react 15.6.1 #3

Open
estaub opened this issue Jul 8, 2017 · 0 comments
Open

Type problem in 0.7.4 with Typescript 2.4.1 + react 15.6.1 #3

estaub opened this issue Jul 8, 2017 · 0 comments

Comments

@estaub
Copy link

estaub commented Jul 8, 2017

Typescript 2.4.1 reports when compiling csstransitiongroup.d.ts:

Error:(13, 5) TS2424:Class 'Component<CSSTransitionGroupProps, {}>' defines instance member function 'componentDidMount', but extended class 'CSSTransitionGroup' defines it as instance member property.

This is regarding:

export declare class CSSTransitionGroup extends Component<CSSTransitionGroupProps, {}> {
    static defaultProps: any;
    private mounted;
    componentDidMount: () => boolean;
    render(): JSX.Element;
}

which conflicts with the ComponentLifeCycle member:

componentDidMount?(): void;
I'm surprised that Typescript would care whether it's a member function or member property. Note also that the React def claims componentDidMount() is optional and returns void, whereas react-css-transition claims it is required and returns boolean.

@estaub estaub changed the title Type problem with Typescript 2.4.1 + react 15.6.1 Type problem in 0.7.4 with Typescript 2.4.1 + react 15.6.1 Jul 8, 2017
dleavitt pushed a commit to hyfn/react-css-transition that referenced this issue Aug 15, 2017
This is a suggested fix for wikiwi#3.
Untested, but trivial.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant