Skip to content

Commit

Permalink
Props: #9399 repro test
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Feb 14, 2020
1 parent ed4b831 commit 8063b52
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`react component properties 9399-js-proptypes-shape 1`] = `
"import React from 'react';
import PropTypes from 'prop-types';
export const Credits = ({
areas
}) => React.createElement(React.Fragment, null, JSON.stringify(areas)); // https://github.com/storybookjs/storybook/issues/9399

Credits.propTypes = {
areas: PropTypes.arrayOf(PropTypes.shape({
position: PropTypes.string.isRequired,
names: PropTypes.arrayOf(PropTypes.string).isRequired
})).isRequired
};
export const component = Credits;
Credits.__docgenInfo = {
\\"description\\": \\"\\",
\\"methods\\": [],
\\"displayName\\": \\"Credits\\",
\\"props\\": {
\\"areas\\": {
\\"type\\": {
\\"name\\": \\"arrayOf\\",
\\"value\\": {
\\"name\\": \\"shape\\",
\\"value\\": {
\\"position\\": {
\\"name\\": \\"string\\",
\\"required\\": true
},
\\"names\\": {
\\"name\\": \\"arrayOf\\",
\\"value\\": {
\\"name\\": \\"string\\"
},
\\"required\\": true
}
}
}
},
\\"required\\": true,
\\"description\\": \\"\\"
}
}
};"
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import PropTypes from 'prop-types';

export const Credits = ({ areas }) => <>{JSON.stringify(areas)}</>;

// https://github.com/storybookjs/storybook/issues/9399
Credits.propTypes = {
areas: PropTypes.arrayOf(
PropTypes.shape({
position: PropTypes.string.isRequired,
names: PropTypes.arrayOf(PropTypes.string).isRequired,
})
).isRequired,
};

export const component = Credits;

0 comments on commit 8063b52

Please sign in to comment.