Skip to content

Commit 2abd5de

Browse files
committed
JSX.Element => React.ReactNode
1 parent 2a4dd6d commit 2abd5de

File tree

12 files changed

+30
-22
lines changed

12 files changed

+30
-22
lines changed

src/components/HomepageFeatures/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Heading from "@theme/Heading";
99
type FeatureItem = {
1010
title: string;
1111
Svg: React.ComponentType<React.ComponentProps<"svg">>;
12-
description: JSX.Element;
12+
description: React.ReactNode;
1313
};
1414

1515
const FeatureList: FeatureItem[] = [
@@ -52,7 +52,7 @@ function Feature({ title, description }: FeatureItem) {
5252
);
5353
}
5454

55-
export default function HomepageFeatures(): JSX.Element {
55+
export default function HomepageFeatures(): React.ReactNode {
5656
return (
5757
<section className={styles.features}>
5858
<div className="container">

src/components/conformance/HeroBanner/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ interface BannerProps {
1717
focusItems: VersionItem[];
1818
}
1919

20-
export default function ConformanceHeroBanner(props: BannerProps): JSX.Element {
20+
export default function ConformanceHeroBanner(
21+
props: BannerProps,
22+
): React.ReactNode {
2123
return (
2224
<div className={styles.bannerSection}>
2325
{props.focusItems.map((item) => {

src/components/conformance/ResultsDisplay/components/SuiteDataContainer/cards/TestGrid/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type TestsGridProps = {
1717
selectTest: (string) => void;
1818
};
1919

20-
export default function TestsGrid(props: TestsGridProps): JSX.Element {
20+
export default function TestsGrid(props: TestsGridProps): React.ReactNode {
2121
const [hoverName, setHoverName] = React.useState<undefined | string>();
2222
const cardBodyClass = "card__body " + styles.gridStyle;
2323

@@ -64,7 +64,7 @@ function applyFilter(filter: FilterOption, outcome: TestOutcome): boolean {
6464
}
6565
}
6666

67-
function Grid(props: GridProps): JSX.Element {
67+
function Grid(props: GridProps): React.ReactNode {
6868
return (
6969
<>
7070
{props.esFlag
@@ -103,7 +103,7 @@ type GridItemProps = {
103103
setHoverValue: (test: string | undefined) => void;
104104
};
105105

106-
function GridItem(props: GridItemProps): JSX.Element {
106+
function GridItem(props: GridItemProps): React.ReactNode {
107107
let testResult: string;
108108
switch (props.test.result) {
109109
case TestOutcome.Passed:

src/components/conformance/ResultsDisplay/components/SuiteDataContainer/cards/TestViewer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type TestViewerProps = {
1010
backToGrid: () => void;
1111
};
1212

13-
export default function TestViewer(props: TestViewerProps): JSX.Element {
13+
export default function TestViewer(props: TestViewerProps): React.ReactNode {
1414
const [testContent, setTestContent] = React.useState<string | null>(null);
1515

1616
// path constants

src/components/conformance/ResultsDisplay/components/SuiteDataContainer/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ type SuiteDataProps = {
1515
setSelectedTest: (string) => void;
1616
};
1717

18-
export default function SuiteDataContainer(props: SuiteDataProps): JSX.Element {
18+
export default function SuiteDataContainer(
19+
props: SuiteDataProps,
20+
): React.ReactNode {
1921
// Set the user's selected test to be displayed in the ViewPort.
2022
const selectTest = (testName: string) => {
2123
props.setSelectedTest(testName);

src/components/conformance/ResultsDisplay/components/SuiteDisplay/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ type SuiteDisplayProps = {
1616
setSelectedTest: (string) => void;
1717
};
1818

19-
export default function SuiteDisplay(props: SuiteDisplayProps): JSX.Element {
19+
export default function SuiteDisplay(
20+
props: SuiteDisplayProps,
21+
): React.ReactNode {
2022
return (
2123
<div className={styles.suiteDisplay}>
2224
{props.currentSuite.suites ? (

src/components/conformance/ResultsDisplay/components/SuiteSelector/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type SelectorProps = {
1616
navigateToSuite: (string) => void;
1717
};
1818

19-
export default function SuiteSelector(props: SelectorProps): JSX.Element {
19+
export default function SuiteSelector(props: SelectorProps): React.ReactNode {
2020
const option: SortOption[] = availableSortingOptions.filter(
2121
(v) => v.id === props.state.sortOption,
2222
);
@@ -52,7 +52,7 @@ type SuiteItemProps = {
5252
navigateToSuite: (string) => void;
5353
};
5454

55-
function SuiteItem(props: SuiteItemProps): JSX.Element {
55+
function SuiteItem(props: SuiteItemProps): React.ReactNode {
5656
return (
5757
<div
5858
className={styles.suiteCard}
@@ -81,7 +81,7 @@ type StatProps = {
8181
function SuiteStatistics({
8282
testResults,
8383
filterOption,
84-
}: StatProps): JSX.Element {
84+
}: StatProps): React.ReactNode {
8585
const [filter, setFilter] = React.useState(filterOption);
8686

8787
React.useEffect(() => {

src/components/conformance/ResultsDisplay/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type ResultsProps = {
2020
state: ConformanceState;
2121
};
2222

23-
export default function ResultsDisplay(props: ResultsProps): JSX.Element {
23+
export default function ResultsDisplay(props: ResultsProps): React.ReactNode {
2424
const [currentSuite, setCurrentSuite] = React.useState<SuiteResult | null>(
2525
null,
2626
);

src/components/conformance/ResultsDisplay/nav.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ type ResultsNavProps = {
1414
setFilterOption: (string) => void;
1515
};
1616

17-
export default function ResultNavigation(props: ResultsNavProps): JSX.Element {
17+
export default function ResultNavigation(
18+
props: ResultsNavProps,
19+
): React.ReactNode {
1820
return (
1921
<div className={styles.resultsNav}>
2022
<div className={styles.navSection}>
@@ -77,7 +79,7 @@ type BreadCrumbItemProps = {
7779
sliceNavToIndex: (number) => void;
7880
};
7981

80-
function BreadCrumbItem(props: BreadCrumbItemProps): JSX.Element {
82+
function BreadCrumbItem(props: BreadCrumbItemProps): React.ReactNode {
8183
return (
8284
<li className={props.breadcrumbValue}>
8385
<Link
@@ -97,7 +99,7 @@ type DropDownProps = {
9799
setEcmaScriptFlag: (string) => void;
98100
};
99101

100-
function EcmaScriptVersionDropdown(props: DropDownProps): JSX.Element {
102+
function EcmaScriptVersionDropdown(props: DropDownProps): React.ReactNode {
101103
const [dropdownValue, setDropdownValue] = React.useState(
102104
props.esVersionValue ? props.esVersionValue : "",
103105
);
@@ -139,7 +141,7 @@ type SortProps = {
139141
setSortOption: (string) => void;
140142
};
141143

142-
function SortingDropdown(props: SortProps): JSX.Element {
144+
function SortingDropdown(props: SortProps): React.ReactNode {
143145
const [sortValue, setSortValue] = React.useState<string>(
144146
props.sortValue ? props.sortValue : "alpha",
145147
);
@@ -179,7 +181,7 @@ type FilterProps = {
179181
setFilterOption: (string) => void;
180182
};
181183

182-
function FilterDropdown(props: FilterProps): JSX.Element {
184+
function FilterDropdown(props: FilterProps): React.ReactNode {
183185
const [filterValue, setFilterValue] = React.useState<string>(
184186
props.filterOption ?? FilterOption.None,
185187
);

src/components/conformance/VersionSelector/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface SelectorProps {
1111
availableVersions: VersionItem[];
1212
}
1313

14-
export default function VersionSelector(props: SelectorProps): JSX.Element {
14+
export default function VersionSelector(props: SelectorProps): React.ReactNode {
1515
return (
1616
<div className={styles.versionSelector}>
1717
{props.availableVersions.map((version) => {
@@ -25,7 +25,7 @@ type VersionProps = {
2525
version: VersionItem;
2626
};
2727

28-
function Version(props: VersionProps): JSX.Element {
28+
function Version(props: VersionProps): React.ReactNode {
2929
const history = useHistory<ConformanceState>();
3030

3131
return (

0 commit comments

Comments
 (0)