diff --git a/.changeset/rich-melons-compete.md b/.changeset/rich-melons-compete.md new file mode 100644 index 0000000000..68297159f7 --- /dev/null +++ b/.changeset/rich-melons-compete.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-gcalendar': patch +--- + +Upgrade `react-query:3` to `@tanstack/react-query:4` diff --git a/plugins/gcalendar/package.json b/plugins/gcalendar/package.json index f46660f942..9f72bcb222 100644 --- a/plugins/gcalendar/package.json +++ b/plugins/gcalendar/package.json @@ -30,13 +30,13 @@ "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", "@maxim_mazurok/gapi.client.calendar": "^3.0.20220408", + "@tanstack/react-query": "^4.1.3", "classnames": "^2.3.1", "cross-fetch": "^3.1.5", "dompurify": "^2.3.6", "lodash": "^4.17.21", "luxon": "^3.0.0", "material-ui-popup-state": "^1.9.3", - "react-query": "^3.34.16", "react-use": "^17.2.4" }, "peerDependencies": { diff --git a/plugins/gcalendar/src/components/CalendarCard/CalendarCard.tsx b/plugins/gcalendar/src/components/CalendarCard/CalendarCard.tsx index b698c23ea1..a5575bc190 100644 --- a/plugins/gcalendar/src/components/CalendarCard/CalendarCard.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/CalendarCard.tsx @@ -15,7 +15,7 @@ */ import { sortBy } from 'lodash'; import { DateTime } from 'luxon'; -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { InfoCard, Progress } from '@backstage/core-components'; import { useAnalytics } from '@backstage/core-plugin-api'; @@ -35,6 +35,7 @@ import { CalendarEvent } from './CalendarEvent'; import { CalendarSelect } from './CalendarSelect'; import { SignInContent } from './SignInContent'; import { getStartDate } from './util'; +import useAsync from 'react-use/lib/useAsync'; export const CalendarCard = () => { const [date, setDate] = useState(DateTime.now()); @@ -47,9 +48,7 @@ export const CalendarCard = () => { const { isSignedIn, isInitialized, signIn } = useSignIn(); - useEffect(() => { - signIn(true); - }, [signIn]); + useAsync(async () => signIn(true), [signIn]); const { isLoading: isCalendarLoading, data: calendars = [] } = useCalendarsQuery({ diff --git a/plugins/gcalendar/src/components/CalendarCard/CalendarSelect.tsx b/plugins/gcalendar/src/components/CalendarCard/CalendarSelect.tsx index a1e037a2a3..cd48d9ad3e 100644 --- a/plugins/gcalendar/src/components/CalendarCard/CalendarSelect.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/CalendarSelect.tsx @@ -58,7 +58,6 @@ export const CalendarSelect = ({ calendars, }: CalendarSelectProps) => { const classes = useStyles(); - return (