Props: #9668 attempted repro

This commit is contained in:
Michael Shilman 2020-02-14 16:58:35 +08:00
parent b467fa8c95
commit 8219af19d0
4 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,40 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`react component properties 9668-js-proptypes-no-jsdoc 1`] = `
"/* eslint-disable react/require-default-props */
/* eslint-disable react/no-unused-prop-types */
/* eslint-disable react/forbid-prop-types */
import React from 'react';
import PropTypes from 'prop-types';
const CCTable = props => React.createElement(React.Fragment, null, JSON.stringify(props));
CCTable.propTypes = {
heads: PropTypes.array.isRequired,
onAddClick: PropTypes.func
};
export const component = CCTable;
CCTable.__docgenInfo = {
\\"description\\": \\"\\",
\\"methods\\": [],
\\"displayName\\": \\"CCTable\\",
\\"props\\": {
\\"heads\\": {
\\"type\\": {
\\"name\\": \\"array\\"
},
\\"required\\": true,
\\"description\\": \\"\\"
},
\\"onAddClick\\": {
\\"type\\": {
\\"name\\": \\"func\\"
},
\\"required\\": false,
\\"description\\": \\"\\"
}
}
};"
`;

View File

@ -0,0 +1,13 @@
/* eslint-disable react/require-default-props */
/* eslint-disable react/no-unused-prop-types */
/* eslint-disable react/forbid-prop-types */
import React from 'react';
import PropTypes from 'prop-types';
const CCTable = props => <>{JSON.stringify(props)}</>;
CCTable.propTypes = {
heads: PropTypes.array.isRequired,
onAddClick: PropTypes.func,
};
export const component = CCTable;

View File

@ -0,0 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`react component properties 9668-js-proptypes-no-jsdoc 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": null,
"description": "",
"name": "heads",
"required": true,
"type": Object {
"detail": undefined,
"summary": "array",
},
},
Object {
"defaultValue": null,
"description": "",
"name": "onAddClick",
"required": false,
"type": Object {
"detail": undefined,
"summary": "func",
},
},
],
}
`;

View File

@ -9,6 +9,7 @@ const fixtures = [
'9399-js-proptypes-shape',
'8663-js-styled-components',
'9626-js-default-values',
'9668-js-proptypes-no-jsdoc',
];
const stories = storiesOf('Properties/React', module);