Skip to content

Commit 664ed89

Browse files
committed
chore: Prepare types for React 19 upgrade
1 parent dcc8151 commit 664ed89

68 files changed

Lines changed: 103 additions & 131 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

static/js/publisher/components/AppPagination/AppPagination.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, ReactNode } from "react";
1+
import { useState, useEffect } from "react";
22
import { Button, Icon, Input, Select } from "@canonical/react-components";
33

44
import type {
@@ -19,7 +19,7 @@ function AppPagination<T extends ItemType>({
1919
keyword,
2020
items,
2121
setItemsToShow,
22-
}: Props<T>): ReactNode {
22+
}: Props<T>): React.JSX.Element {
2323
const paginationOptions = [
2424
{
2525
label: "25/page",

static/js/publisher/components/Filter/Filter.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { useSearchParams } from "react-router-dom";
22
import { RecoilState, useSetRecoilState } from "recoil";
33
import { Button, Icon } from "@canonical/react-components";
4-
import { ReactNode } from "react";
5-
64
type Props = {
75
state: RecoilState<string>;
86
label: string;
97
placeholder: string;
108
};
119

12-
function Filter({ state, label, placeholder }: Props): ReactNode {
10+
function Filter({ state, label, placeholder }: Props): React.JSX.Element {
1311
const [searchParams, setSearchParams] = useSearchParams();
1412
const setFilter = useSetRecoilState(state);
1513

static/js/publisher/components/Logo/Logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Logo(): JSX.Element {
1+
function Logo(): React.JSX.Element {
22
return (
33
<a href="/" className="p-panel__logo tag-logo">
44
<img

static/js/publisher/components/Navigation/Logo.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { ReactNode } from "react";
2-
3-
function Logo(): ReactNode {
1+
function Logo(): React.JSX.Element {
42
return (
53
<a href="/" className="p-panel__logo">
64
<img

static/js/publisher/components/Navigation/Navigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, ReactNode } from "react";
1+
import { useState, useEffect } from "react";
22
import { useRecoilState, useRecoilValue } from "recoil";
33
import { useParams, NavLink } from "react-router-dom";
44
import { Icon } from "@canonical/react-components";
@@ -16,7 +16,7 @@ function Navigation({
1616
sectionName,
1717
}: {
1818
sectionName: string | null;
19-
}): ReactNode {
19+
}): React.JSX.Element {
2020
const brandStoresList = useRecoilValue(brandStoresState);
2121
const { id } = useParams();
2222
const { data: brand } = useBrand(id);

static/js/publisher/components/PrimaryNav/PrimaryNav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function PrimaryNav({
1818
}: {
1919
collapseNavigation: boolean;
2020
setCollapseNavigation: (value: boolean) => void;
21-
}): JSX.Element {
21+
}): React.JSX.Element {
2222
const location = useLocation();
2323
const { data: publisherData } = usePublisher();
2424
const { data: validationSetsData } = useValidationSets();

static/js/publisher/components/StoreSelector/StoreSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, ReactNode } from "react";
1+
import { useState, useEffect } from "react";
22
import { useRecoilValue } from "recoil";
33
import { useParams, NavLink } from "react-router-dom";
44

@@ -10,7 +10,7 @@ type Props = {
1010
nativeNavLink?: boolean;
1111
};
1212

13-
function StoreSelector({ nativeNavLink }: Props): ReactNode {
13+
function StoreSelector({ nativeNavLink }: Props): React.JSX.Element {
1414
const { id } = useParams();
1515
const brandStoresList = useRecoilValue(brandStoresState);
1616
const [showStoreSelector, setShowStoreSelector] = useState<boolean>(false);

static/js/publisher/components/Tour/Tour.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Props = {
88
steps: {
99
target: string;
1010
title: string;
11-
content: JSX.Element;
11+
content: React.JSX.Element;
1212
disableBeacon?: boolean;
1313
}[];
1414
};

static/js/publisher/pages/AccountDetails/AccountDetails.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, SyntheticEvent, ReactNode } from "react";
1+
import { useState, useEffect, SyntheticEvent } from "react";
22
import { useRecoilValue } from "recoil";
33
import {
44
Row,
@@ -13,7 +13,7 @@ import Navigation from "../../components/Navigation";
1313

1414
import { publisherState } from "../../state/publisherState";
1515

16-
function AccountDetails(): ReactNode {
16+
function AccountDetails(): React.JSX.Element {
1717
const [subscriptionPreferencesChanged, setSubscriptionPreferencesChanged] =
1818
useState(false);
1919
const [subscribeToNewsletter, setSubscribeToNewsletter] = useState(false);

static/js/publisher/pages/Build/Build.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SectionNav from "../../components/SectionNav";
77

88
import { setPageTitle } from "../../utils";
99

10-
function Build(): JSX.Element {
10+
function Build(): React.JSX.Element {
1111
const { buildId, snapId } = useParams();
1212
const { data, isFetched, isLoading, isFetching } = useQuery({
1313
queryKey: ["build", snapId, buildId],

0 commit comments

Comments
 (0)