Skip to content

Commit 6fe8fab

Browse files
committed
chore: Upgrade to React 19
1 parent dcc8151 commit 6fe8fab

71 files changed

Lines changed: 188 additions & 169 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.

package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"@testing-library/user-event": "14.5.2",
4949
"@types/jest": "29.5.14",
5050
"@types/randomstring": "1.3.0",
51-
"@types/react": "18.3.18",
52-
"@types/react-dom": "18.3.5",
51+
"@types/react": "19.1.0",
52+
"@types/react-dom": "19.1.0",
5353
"@types/react-redux": "7.1.34",
5454
"@types/react-router-dom": "5.3.3",
5555
"@types/topojson-client": "3.1.5",
@@ -81,10 +81,10 @@
8181
"prop-types": "15.8.1",
8282
"randomstring": "1.3.0",
8383
"raven-js": "3.27.2",
84-
"react": "18.3.1",
84+
"react": "19.1.0",
8585
"react-dnd": "16.0.1",
8686
"react-dnd-html5-backend": "16.0.1",
87-
"react-dom": "18.3.1",
87+
"react-dom": "19.1.0",
8888
"react-hook-form": "7.54.2",
8989
"react-joyride": "2.9.3",
9090
"react-query": "3.39.3",
@@ -134,9 +134,5 @@
134134
"stylelint-config-standard-scss": "14.0.0",
135135
"stylelint-order": "6.0.4",
136136
"ts-jest": "29.2.5"
137-
},
138-
"resolutions": {
139-
"@types/react": "18.3.18",
140-
"@types/react-dom": "18.3.5"
141137
}
142138
}

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
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";
54

65
type Props = {
76
state: RecoilState<string>;
87
label: string;
98
placeholder: string;
109
};
1110

12-
function Filter({ state, label, placeholder }: Props): ReactNode {
11+
function Filter({ state, label, placeholder }: Props): React.JSX.Element {
1312
const [searchParams, setSearchParams] = useSearchParams();
1413
const setFilter = useSetRecoilState(state);
1514

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);

0 commit comments

Comments
 (0)