mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 04:01:48 +08:00
Props: #9592 styled repro
This commit is contained in:
parent
92f8c43334
commit
c8c19a2e4e
@ -0,0 +1,33 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`react component properties 9592-ts-styled-props 1`] = `
|
||||||
|
"import React from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
const StyledHello = styled.div\`
|
||||||
|
color: red;
|
||||||
|
\`;
|
||||||
|
|
||||||
|
const Hello = ({
|
||||||
|
title
|
||||||
|
}) => {
|
||||||
|
return React.createElement(StyledHello, {
|
||||||
|
className: \\"hello\\"
|
||||||
|
}, \\"Hello Component \\", title);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const component = Hello;
|
||||||
|
Hello.__docgenInfo = {
|
||||||
|
\\"description\\": \\"\\",
|
||||||
|
\\"methods\\": [],
|
||||||
|
\\"displayName\\": \\"Hello\\",
|
||||||
|
\\"props\\": {
|
||||||
|
\\"title\\": {
|
||||||
|
\\"required\\": true,
|
||||||
|
\\"tsType\\": {
|
||||||
|
\\"name\\": \\"string\\"
|
||||||
|
},
|
||||||
|
\\"description\\": \\"\\"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};"
|
||||||
|
`;
|
@ -0,0 +1,16 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
interface HelloProps {
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const StyledHello = styled.div`
|
||||||
|
color: red;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const Hello = ({ title }: HelloProps) => {
|
||||||
|
return <StyledHello className="hello">Hello Component {title}</StyledHello>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const component = Hello;
|
@ -0,0 +1,21 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`react component properties 9592-ts-styled-props 1`] = `
|
||||||
|
Object {
|
||||||
|
"rows": Array [
|
||||||
|
Object {
|
||||||
|
"defaultValue": Object {
|
||||||
|
"detail": undefined,
|
||||||
|
"summary": "0",
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"name": "title",
|
||||||
|
"required": true,
|
||||||
|
"type": Object {
|
||||||
|
"detail": undefined,
|
||||||
|
"summary": "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
`;
|
@ -18,6 +18,7 @@ const fixtures = [
|
|||||||
'8740-ts-multi-props',
|
'8740-ts-multi-props',
|
||||||
'8894-ts-forward-ref',
|
'8894-ts-forward-ref',
|
||||||
'9556-ts-react-default-exports',
|
'9556-ts-react-default-exports',
|
||||||
|
'9592-ts-styled-props',
|
||||||
];
|
];
|
||||||
|
|
||||||
const stories = storiesOf('Properties/React', module);
|
const stories = storiesOf('Properties/React', module);
|
||||||
|
1
addons/docs/src/typings.d.ts
vendored
1
addons/docs/src/typings.d.ts
vendored
@ -10,3 +10,4 @@ declare module 'babel-plugin-react-docgen';
|
|||||||
declare module 'require-from-string';
|
declare module 'require-from-string';
|
||||||
declare module 'tmp';
|
declare module 'tmp';
|
||||||
declare module 'cross-spawn';
|
declare module 'cross-spawn';
|
||||||
|
declare module 'styled-components';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user