Skip to content

Commit

Permalink
fix(addon-docs): add any types to props so it builds
Browse files Browse the repository at this point in the history
  • Loading branch information
andezzat committed Oct 1, 2020
1 parent 73369c2 commit 77ec4c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
@@ -1,3 +1,4 @@
{
"deepscan.enable": true
"deepscan.enable": true,
"editor.tabSize": 2
}
18 changes: 9 additions & 9 deletions addons/docs/src/frameworks/react/jsxDecorator.test.tsx
Expand Up @@ -103,26 +103,26 @@ describe('renderJsx', () => {
'item 18',
'item 19'
]}
/>
/>
`);
});

it('forwardRef component', () => {
const MyExoticComponent = React.forwardRef(function MyExoticComponent({ children }, _ref) {
return <div>{children}</div>;
const MyExoticComponent = React.forwardRef(function MyExoticComponent(props: any, _ref: any) {
return <div>{props.children}</div>;
});

expect(renderJsx(<MyExoticComponent>I'm forwardRef!</MyExoticComponent>, {}))
.toMatchInlineSnapshot(`
<MyExoticComponent>
I'm forwardRef!
</MyExoticComponent>
`);
<MyExoticComponent>
I'm forwardRef!
</MyExoticComponent>
`);
});

it('memo component', () => {
const MyMemoComponent = React.memo(function MyMemoComponent({ children }) {
return <div>{children}</div>;
const MyMemoComponent = React.memo(function MyMemoComponent(props: any) {
return <div>{props.children}</div>;
});

expect(renderJsx(<MyMemoComponent>I'm memo!</MyMemoComponent>, {})).toMatchInlineSnapshot(`
Expand Down

0 comments on commit 77ec4c6

Please sign in to comment.