Skip to content

Commit

Permalink
Props: #9556 repro
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Feb 14, 2020
1 parent 822f3df commit 92f8c43
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`react component properties 9556-ts-react-default-exports 1`] = `
"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

/* eslint-disable react/button-has-type */
import React from 'react';
export const Button = ({
isDisabled = false,
...props
}) => React.createElement(\\"button\\", _extends({
disabled: isDisabled
}, props));
export const component = Button;
Button.__docgenInfo = {
\\"description\\": \\"\\",
\\"methods\\": [],
\\"displayName\\": \\"Button\\",
\\"props\\": {
\\"isDisabled\\": {
\\"defaultValue\\": {
\\"value\\": \\"false\\",
\\"computed\\": false
},
\\"required\\": false,
\\"tsType\\": {
\\"name\\": \\"boolean\\"
},
\\"description\\": \\"\\"
}
}
};"
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable react/button-has-type */
import React from 'react';

export interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
isDisabled?: boolean;
}

export const Button: React.FC<Props> = ({ isDisabled = false, ...props }: Props) => (
<button disabled={isDisabled} {...props} />
);

export const component = Button;
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 9556-ts-react-default-exports 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "false",
},
"description": "",
"name": "isDisabled",
"required": false,
"type": Object {
"detail": undefined,
"summary": "boolean",
},
},
],
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const fixtures = [
'9023-js-hoc',
'8740-ts-multi-props',
'8894-ts-forward-ref',
'9556-ts-react-default-exports',
];

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

0 comments on commit 92f8c43

Please sign in to comment.