Skip to content

Commit

Permalink
[docs] : Chnage return value of LargeTree component to any
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshf22 committed Oct 17, 2019
1 parent 121e9db commit 9c71f6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
8 changes: 1 addition & 7 deletions docs/src/pages/components/no-ssr/FrameDeferring.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ const useStyles = makeStyles({
});

function LargeTree() {
return (
<>
{Array.from(new Array(3000)).map((_, index) => (
<span key={index}>.</span>
))}
</>
);
return Array.from(new Array(3000)).map((_, index) => <span key={index}>.</span>);
}

function FrameDeferring() {
Expand Down
16 changes: 8 additions & 8 deletions docs/src/pages/components/no-ssr/FrameDeferring.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ const useStyles = makeStyles({
},
});

function LargeTree() {
return (
<>
{Array.from(new Array(3000)).map((_, index) => (
<span key={index}>.</span>
))}
</>
);
/**
* Changing the return value of this component to `any`
* As currently typescript does not support returning array from components
*
* https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20356
*/
function LargeTree(): any {
return Array.from(new Array(3000)).map((_, index) => <span key={index}>.</span>);
}

function FrameDeferring() {
Expand Down

0 comments on commit 9c71f6d

Please sign in to comment.