Skip to content

Commit

Permalink
chore(deps): update to react v19 and fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverDudgeon committed Jan 5, 2025
1 parent b17cc23 commit d9f0ed5
Show file tree
Hide file tree
Showing 7 changed files with 363 additions and 367 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@types/node": "22.9.0",
"@types/plotly.js-basic-dist": "1.54.4",
"@types/prismjs": "1.26.5",
"@types/react": "18.3.18",
"@types/react": "19.0.2",
"@types/react-plotly.js": "2.6.3",
"axios": "1.7.9",
"dayjs": "1.11.13",
Expand All @@ -90,8 +90,8 @@
"notistack": "3.0.1",
"plotly.js-basic-dist": "2.35.3",
"prismjs": "1.29.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-dropzone": "14.3.5",
"react-hook-form": "7.54.2",
"react-plotly.js": "2.6.0",
Expand Down
654 changes: 324 additions & 330 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/components/DataTable/IndeterminateCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ForwardedRef, forwardRef, type MutableRefObject, useEffect, useRef } from "react";
import { type ForwardedRef, forwardRef, type RefObject, useEffect, useRef } from "react";

import { Checkbox, type CheckboxProps } from "@mui/material";

Expand All @@ -10,8 +10,8 @@ const IndeterminateCheckboxComponent = (
{ indeterminate, ...rest }: CheckboxProps,
ref: ForwardedRef<HTMLInputElement>,
) => {
const defaultRef = useRef();
const resolvedRef = (ref ?? defaultRef) as MutableRefObject<HTMLButtonElement>;
const defaultRef = useRef<HTMLButtonElement>(null);
const resolvedRef = (ref ?? defaultRef) as RefObject<HTMLButtonElement>;

useEffect(() => {
(resolvedRef.current as HTMLInputElement).indeterminate = !!(indeterminate ?? false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/runCards/JobCard/JobModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const JobModal = ({
Object.keys(inputsData).length > 0 ? inputsData : specInputs,
);

const formRef = useRef<any>();
const formRef = useRef<any>(null);

// Since the default value are obtained async, we have to wait for them to arrive in order to set
useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/userContext/SelectUnit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export const SelectUnit = ({
}}
/>
)}
renderOption={(props, option) => (
<Box component="li" {...props}>
renderOption={({ key, ...props }, option) => (
<Box component="li" key={key} {...props}>
<Box component="span" sx={{ display: "inline-block", pr: 1 }}>
<ItemIcons item={option} />
</Box>
Expand Down
4 changes: 2 additions & 2 deletions src/features/DatasetUpload/SingleFileUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export const SingleFileUploadWithProgress = ({
changeMimeType,
}: SingleFileUploadWithProgressProps) => {
const queryClient = useQueryClient();
const fileNameRef = useRef<HTMLInputElement>();
const fileExtRef = useRef<HTMLInputElement>();
const fileNameRef = useRef<HTMLInputElement>(null);
const fileExtRef = useRef<HTMLInputElement>(null);

const composeNewFilePath = () => {
return `${fileNameRef.current?.value}${fileExtRef.current?.value}`;
Expand Down
54 changes: 28 additions & 26 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo } from "react";
import { StrictMode, useMemo } from "react";

import { setBaseUrl as setASBaseUrl } from "@squonk/account-server-client";
import { setBaseUrl as setDMBaseUrl } from "@squonk/data-manager-client";
Expand Down Expand Up @@ -52,31 +52,33 @@ const App = ({ Component, pageProps }: CustomAppProps) => {
// }

return (
<AppCacheProvider {...pageProps}>
<Head>
<meta content="minimum-scale=1, initial-scale=1, width=device-width" name="viewport" />
<style>{openSansFontCss}</style>
</Head>
<ThemeProviders>
<UserProvider
loginUrl={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/auth/login`}
profileUrl={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/auth/me`}
>
<QueryClientProvider client={queryClient}>
<HydrationBoundary state={pageProps.dehydratedState}>
<SnackbarProvider>
<MDXComponentProvider>
<TopLevelHooks>
<Component {...pageProps} />
</TopLevelHooks>
</MDXComponentProvider>
</SnackbarProvider>
</HydrationBoundary>
<ReactQueryDevtools client={queryClient} />
</QueryClientProvider>
</UserProvider>
</ThemeProviders>
</AppCacheProvider>
<StrictMode>
<AppCacheProvider {...pageProps}>
<Head>
<meta content="minimum-scale=1, initial-scale=1, width=device-width" name="viewport" />
<style>{openSansFontCss}</style>
</Head>
<ThemeProviders>
<UserProvider
loginUrl={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/auth/login`}
profileUrl={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/auth/me`}
>
<QueryClientProvider client={queryClient}>
<HydrationBoundary state={pageProps.dehydratedState}>
<SnackbarProvider>
<MDXComponentProvider>
<TopLevelHooks>
<Component {...pageProps} />
</TopLevelHooks>
</MDXComponentProvider>
</SnackbarProvider>
</HydrationBoundary>
<ReactQueryDevtools client={queryClient} />
</QueryClientProvider>
</UserProvider>
</ThemeProviders>
</AppCacheProvider>
</StrictMode>
);
};

Expand Down

0 comments on commit d9f0ed5

Please sign in to comment.