Skip to content

v2.12.0

Compare
Choose a tag to compare
@fkling fkling released this 20 Oct 18:51
· 2378 commits to main since this release

New

  • Support for objectOf prop type (86b167f) (reported as #74)
  • Treat default arguments as default props in stateless components ( #108, @CompuIves)

Improved

  • When passing an unknown value to shape(...), react-docgen will now report that value as computed.

    Example: shape(Child.propTypes)
    Before:

    "type": {
      "name": "shape",
      "value": "unkown"
    }

    Now:

    "type": {
      "name": "shape",
      "value": "Child.propTypes",
      "computed": true
    }

    (eb0edaa) (reported as #87)

  • Resolve static values passed to oneOf. Examples:

    React.PropTypes.oneOf([TYPES.FOO, TYPES.BAR]);
    // or:
    var TYPES = ["FOO", "BAR"];
    React.PropTypes.oneOf(TYPES);
    // or:
    var TYPES = ["A", "B"];
    var MORE = [...TYPES, "C"];
    React.PropTypes.oneOf(MORE);

    (#122, @ZauberNerd)

Fixed

  • Fixed an issue with the output of react-docgen being truncated when piping to another command (#127, @mmeineke)