Skip to content

[defaultValue] not shown (PropTypes.oneOf) #12

Description

@DoubleU23

Hi there!

screenshot:
react-doc-generator_defaultValue

Problem
My default value isn't parsed ? because obj.type.name is not "string" ?
see L80 of react-doc-generator.js

Thoughts
so it just works for PropTypes.string?
why is it necessary to check the propType, if we just want to see the default value!?

const isString = /* obj.type.name === 'string' */
    && typeof obj.defaultValue.value === 'string';

and maybe you can explain what Line82 is for:

const isInvalidValue = (/[^\w\s.&:\-+*,!@%$]+/igm).test(obj.defaultValue.value);

or why does it have to match the isInvalidValue RegExp?

What would be an invalid value for a default value? More important, why?
const isInvalidValue = (/[^\w\s.&:\-+*,!@%$]+/igm).test(obj.defaultValue.value);

best regards,
DoubleU23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions