UNPKG

react-docgen

Version:

A library to extract information from React components for documentation generation.

13 lines (12 loc) 359 B
export default function (documentation) { const props = documentation.props; if (props) { Object.values(props).forEach((propInfo) => { // props with default values should not be required if (propInfo.defaultValue) { propInfo.required = false; } }); } return documentation; }