Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

All propTypes result to any, if PropTypes instead of React.PropTypes is used #146

Closed
timbru31 opened this issue Jul 26, 2016 · 1 comment
Labels

Comments

@timbru31
Copy link

Currently all propTypes default to any, if the following syntax is used instead of React.PropTypes:

import React, {PropTypes} from 'react';
...

    static propTypes = {
        className: PropTypes.string,
        component: PropTypes.string,
        renderOptions: PropTypes.object,
        children: PropTypes.element,
        order: PropTypes.string,
        source: PropTypes.string
    };

The culprit is in https://github.com/KnisterPeter/react-to-typescript-definitions/blob/master/index.ts#L155-L157

In the mentioned example above the node.type is still a MemberExpression, but the node.object.type is Identifier and the node.object.name is PropTypes

using v0.11.1

@KnisterPeter
Copy link
Owner

Duplicate of #119

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

No branches or pull requests

2 participants