Skip to content

React.PropTypes.objectOf parsed as "custom" #74

@AlanBreck

Description

@AlanBreck

Hello,

Props with a prop type of objectOf get parsed as a custom prop type rather than an objectOf prop type with a value property defining what the values of the object should be (like how arrayOf is handled).

Input:

Component.propTypes = {
    optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number),
    optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number),
};

Output:

{
    "optionalArrayOf": {
        "type": {
            "name": "arrayOf",
            "value": {
                "name": "number"
            }
        },
        "required": false,
        "description": ""
    },
    "optionalObjectOf": {
        "type": {
            "name": "custom",
            "raw": "React.PropTypes.objectOf(React.PropTypes.number)"
        },
        "required": false,
        "description": ""
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions