Skip to content

Commit 7b494ac

Browse files
authored
fix(website): switch signature with overload (#9643)
1 parent cd69868 commit 7b494ac

File tree

1 file changed

+8
-10
lines changed
  • apps/website/src/components/model/method

1 file changed

+8
-10
lines changed

apps/website/src/components/model/method/Method.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
ApiMethodSignature,
66
} from '@microsoft/api-extractor-model';
77
import dynamic from 'next/dynamic';
8+
import { Fragment } from 'react';
89
import { MethodDocumentation } from './MethodDocumentation';
910
import { MethodHeader } from './MethodHeader';
1011

@@ -20,17 +21,14 @@ export function Method({
2021
if (method.getMergedSiblings().length > 1) {
2122
// We have overloads, use the overload switcher, but render
2223
// each overload node on the server.
23-
const overloads = method
24-
.getMergedSiblings()
25-
.map((sibling, idx) => (
26-
<MethodDocumentation key={`${sibling.displayName}-${idx}`} method={sibling as ApiMethod | ApiMethodSignature} />
27-
));
24+
const overloads = method.getMergedSiblings().map((sibling, idx) => (
25+
<Fragment key={`${sibling.displayName}-${idx}`}>
26+
<MethodHeader method={sibling as ApiMethod | ApiMethodSignature} />
27+
<MethodDocumentation method={sibling as ApiMethod | ApiMethodSignature} />
28+
</Fragment>
29+
));
2830

29-
return (
30-
<OverloadSwitcher overloads={overloads}>
31-
<MethodHeader method={method} />
32-
</OverloadSwitcher>
33-
);
31+
return <OverloadSwitcher overloads={overloads} />;
3432
}
3533

3634
// We have just a single method, render it on the server.

0 commit comments

Comments
 (0)