Skip to content

Commit f8ffd2a

Browse files
committed
[docs] : Change return value of LargeTree component to any
1 parent 121e9db commit f8ffd2a

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

docs/src/pages/components/no-ssr/FrameDeferring.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ const useStyles = makeStyles({
1010
});
1111

1212
function LargeTree() {
13-
return (
14-
<>
15-
{Array.from(new Array(3000)).map((_, index) => (
16-
<span key={index}>.</span>
17-
))}
18-
</>
19-
);
13+
return Array.from(new Array(3000)).map((_, index) => <span key={index}>.</span>);
2014
}
2115

2216
function FrameDeferring() {

docs/src/pages/components/no-ssr/FrameDeferring.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ const useStyles = makeStyles({
99
},
1010
});
1111

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

2222
function FrameDeferring() {

0 commit comments

Comments
 (0)