Skip to content

Commit

Permalink
Props: #9591 repro
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Feb 14, 2020
1 parent c8c19a2 commit 82ee3a3
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type BarProps = {
foo?: string;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`react component properties 9591-ts-import-types 1`] = `
"import React from 'react';

const Other = props => React.createElement(\\"span\\", props, \\"Other\\");

export const component = Other;
Other.__docgenInfo = {
\\"description\\": \\"\\",
\\"methods\\": [],
\\"displayName\\": \\"Other\\",
\\"props\\": {
\\"other\\": {
\\"required\\": false,
\\"tsType\\": {
\\"name\\": \\"number\\"
},
\\"description\\": \\"\\"
}
}
};"
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { BarProps } from './Bar';

type OtherProps = BarProps & {
other?: number;
};

const Other = (props: OtherProps) => <span {...props}>Other</span>;

export const component = Other;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`react component properties 9591-ts-import-types 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "0",
},
"description": "",
"name": "other",
"required": false,
"type": Object {
"detail": undefined,
"summary": "number",
},
},
],
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const fixtures = [
'8894-ts-forward-ref',
'9556-ts-react-default-exports',
'9592-ts-styled-props',
'9591-ts-import-types',
];

const stories = storiesOf('Properties/React', module);
Expand Down

0 comments on commit 82ee3a3

Please sign in to comment.