babel-plugin-prop-types-schema-generator
Version:
Transfer react prop types to JSON schema
18 lines (17 loc) • 296 B
JavaScript
Comp.propTypes = {
// title for str1
str1: PropTypes.string,
// title for str2
// extraProps1: 1
str2: PropTyeps.string.isRequired,
// extraProps: '3'
str3: string,
/**
* prop1: 1
* prop2: '22'
* prop3: true
* prop4: {sss: 123}
* prop5: [1,2,3]
*/
str4: string.isRequired,
}