mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-31 05:03:21 +08:00
Props: #8428 repro
This commit is contained in:
parent
dd10817f39
commit
28f7a7ef37
@ -0,0 +1,41 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`react component properties 8428-js-static-prop-types 1`] = `
|
||||
"function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/* eslint-disable react/no-unused-prop-types */
|
||||
|
||||
/* eslint-disable react/require-default-props */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types'; // eslint-disable-next-line react/prefer-stateless-function
|
||||
|
||||
export default class Test extends React.Component {
|
||||
render() {
|
||||
return React.createElement(\\"div\\", null, \\"test\\");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_defineProperty(Test, \\"propTypes\\", {
|
||||
/**
|
||||
* Please work...
|
||||
* */
|
||||
test: PropTypes.string
|
||||
});
|
||||
|
||||
export const component = Test;
|
||||
Test.__docgenInfo = {
|
||||
\\"description\\": \\"\\",
|
||||
\\"methods\\": [],
|
||||
\\"displayName\\": \\"Test\\",
|
||||
\\"props\\": {
|
||||
\\"test\\": {
|
||||
\\"type\\": {
|
||||
\\"name\\": \\"string\\"
|
||||
},
|
||||
\\"required\\": false,
|
||||
\\"description\\": \\"Please work...\\"
|
||||
}
|
||||
}
|
||||
};"
|
||||
`;
|
@ -0,0 +1,20 @@
|
||||
/* eslint-disable react/no-unused-prop-types */
|
||||
/* eslint-disable react/require-default-props */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
// eslint-disable-next-line react/prefer-stateless-function
|
||||
export default class Test extends React.Component {
|
||||
static propTypes = {
|
||||
/**
|
||||
* Please work...
|
||||
*/
|
||||
test: PropTypes.string,
|
||||
};
|
||||
|
||||
render() {
|
||||
return <div>test</div>;
|
||||
}
|
||||
}
|
||||
|
||||
export const component = Test;
|
@ -0,0 +1,18 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`react component properties 8428-js-static-prop-types 1`] = `
|
||||
Object {
|
||||
"rows": Array [
|
||||
Object {
|
||||
"defaultValue": null,
|
||||
"description": "Please work...",
|
||||
"name": "test",
|
||||
"required": false,
|
||||
"type": Object {
|
||||
"detail": undefined,
|
||||
"summary": "string",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
`;
|
@ -26,6 +26,7 @@ const fixtures = [
|
||||
'9493-ts-display-name',
|
||||
'8894-9511-ts-forward-ref',
|
||||
'9465-ts-type-props',
|
||||
'8428-js-static-prop-types',
|
||||
];
|
||||
|
||||
const stories = storiesOf('Properties/React', module);
|
||||
|
Loading…
x
Reference in New Issue
Block a user