Skip to content

Commit

Permalink
Merge pull request #840 from L4Ph/upgrade-react-18
Browse files Browse the repository at this point in the history
Migrate to React 18
  • Loading branch information
yoichiro committed Jun 2, 2024
2 parents 06f7f65 + 4952c3e commit cab1b8f
Show file tree
Hide file tree
Showing 7 changed files with 4,397 additions and 3,777 deletions.
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"@mui/material": "^5.15.19",
"@mui/styles": "^5.15.19",
"@pdf-lib/fontkit": "^1.1.1",
"@types/react-helmet-async": "^1.0.3",
"@types/react-image-gallery": "^1.0.4",
"ajv": "^7.0.3",
"axios": "^0.21.1",
"date-fns": "^3.6.0",
Expand All @@ -22,13 +20,13 @@
"pdf-lib": "^1.16.0",
"prop-types": "^15.7.2",
"qs": "^6.10.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-draggable": "^4.4.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-draggable": "^4.4.6",
"react-google-charts": "^4.0.1",
"react-helmet-async": "^1.0.9",
"react-image-gallery": "^1.2.7",
"react-redux": "^7.2.2",
"react-helmet-async": "^2.0.5",
"react-image-gallery": "^1.3.0",
"react-redux": "^9.1.2",
"react-router-dom": "^6.2.1",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
Expand Down Expand Up @@ -85,9 +83,9 @@
"@types/node": "^14.14.22",
"@types/prop-types": "^15.7.4",
"@types/qs": "^6.9.6",
"@types/react": "17.0.8",
"@types/react-dom": "17.0.11",
"@types/react-redux": "^7.1.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-image-gallery": "^1.2.4",
"@types/react-router-dom": "^5.1.6",
"@types/sinon": "^10.0.2",
"@types/w3c-web-hid": "^1.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/catalog/Catalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { Button, CssBaseline } from '@mui/material';
import Header from './header/Header.container';
import Content from './content/Content.container';
import { OptionsObject, ProviderContext, withSnackbar } from 'notistack';
import { OptionsObject, ProviderContext, SnackbarKey, withSnackbar } from 'notistack';

Check warning on line 5 in src/components/catalog/Catalog.tsx

View workflow job for this annotation

GitHub Actions / Build and Deploy (20.x)

Replace `·OptionsObject,·ProviderContext,·SnackbarKey,·withSnackbar·` with `⏎··OptionsObject,⏎··ProviderContext,⏎··SnackbarKey,⏎··withSnackbar,⏎`
import { CatalogActionsType, CatalogStateType } from './Catalog.container';
import { NotificationItem } from '../../actions/actions';
import CloseIcon from '@mui/icons-material/Close';
Expand Down Expand Up @@ -49,7 +49,7 @@ function Catalog(props: CatalogProps) {
removeDisplayedNotification(key as string);
},
// eslint-disable-next-line react/display-name
action: (key: number) => (
action: (key: SnackbarKey) => (
<Button
onClick={() => {
// eslint-disable-next-line react/prop-types
Expand Down
4 changes: 2 additions & 2 deletions src/components/configure/Configure.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-undef */
import React, { useEffect, useState } from 'react';
import './Configure.scss';
import { OptionsObject, ProviderContext, withSnackbar } from 'notistack';
import { OptionsObject, ProviderContext, SnackbarKey, withSnackbar } from 'notistack';

Check warning on line 4 in src/components/configure/Configure.tsx

View workflow job for this annotation

GitHub Actions / Build and Deploy (20.x)

Replace `·OptionsObject,·ProviderContext,·SnackbarKey,·withSnackbar·` with `⏎··OptionsObject,⏎··ProviderContext,⏎··SnackbarKey,⏎··withSnackbar,⏎`
import Header from './header/Header.container';
import Content from './content/Content.container';
import {
Expand Down Expand Up @@ -50,7 +50,7 @@ function Configure(props: ConfigureProps) {
removeDisplayedNotification(key as string);
},
// eslint-disable-next-line react/display-name
action: (key: number) => (
action: (key: SnackbarKey) => (
<Button
onClick={() => {
props.closeSnackbar(key);
Expand Down
4 changes: 2 additions & 2 deletions src/components/keyboards/KeyboardDefinitionManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
KeyboardDefinitionManagementActionsType,
KeyboardDefinitionManagementStateType,
} from './KeyboardDefinitionManagement.container';
import { OptionsObject, ProviderContext, withSnackbar } from 'notistack';
import { OptionsObject, ProviderContext, SnackbarKey, withSnackbar } from 'notistack';

Check warning on line 6 in src/components/keyboards/KeyboardDefinitionManagement.tsx

View workflow job for this annotation

GitHub Actions / Build and Deploy (20.x)

Replace `·OptionsObject,·ProviderContext,·SnackbarKey,·withSnackbar·` with `⏎··OptionsObject,⏎··ProviderContext,⏎··SnackbarKey,⏎··withSnackbar,⏎`
import { NotificationItem } from '../../actions/actions';
import { Button, CssBaseline } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
Expand Down Expand Up @@ -50,7 +50,7 @@ function KeyboardDefinitionManagement(
removeDisplayedNotification(key as string);
},
// eslint-disable-next-line react/display-name
action: (key: number) => (
action: (key: SnackbarKey) => (
<Button
onClick={() => {
// eslint-disable-next-line react/prop-types
Expand Down
4 changes: 2 additions & 2 deletions src/components/organizations/OrganizationManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
OrganizationManagementActionsType,
OrganizationManagementStateType,
} from './OrganizationManagement.container';
import { OptionsObject, ProviderContext, withSnackbar } from 'notistack';
import { OptionsObject, ProviderContext, SnackbarKey, withSnackbar } from 'notistack';

Check warning on line 5 in src/components/organizations/OrganizationManagement.tsx

View workflow job for this annotation

GitHub Actions / Build and Deploy (20.x)

Replace `·OptionsObject,·ProviderContext,·SnackbarKey,·withSnackbar·` with `⏎··OptionsObject,⏎··ProviderContext,⏎··SnackbarKey,⏎··withSnackbar,⏎`
import { NotificationItem } from '../../actions/actions';
import React, { useEffect, useState } from 'react';
import { Button, CssBaseline } from '@mui/material';
Expand Down Expand Up @@ -48,7 +48,7 @@ function OrganizationManagement(props: OrganizationManagementProps) {
removeDisplayedNotification(key as string);
},
// eslint-disable-next-line react/display-name
action: (key: number) => (
action: (key: SnackbarKey) => (
<Button
onClick={() => {
// eslint-disable-next-line react/prop-types
Expand Down
7 changes: 4 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ import reportWebVitals from './reportWebVitals';
import OGP from './components/common/ogp/OGP.container';
import { HelmetProvider } from 'react-helmet-async';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { createRoot } from "react-dom/client"

Check warning on line 14 in src/index.tsx

View workflow job for this annotation

GitHub Actions / Build and Deploy (20.x)

Replace `"react-dom/client"` with `'react-dom/client';`

const store = createStore(
reducers,
composeWithDevTools(applyMiddleware(thunk))
);

const theme = createTheme({});
const container = document.getElementById('root');
const root = createRoot(container!);

ReactDOM.render(
root.render(
<Provider store={store}>
<React.StrictMode>
<HelmetProvider>
Expand All @@ -30,8 +33,6 @@ ReactDOM.render(
</HelmetProvider>
</React.StrictMode>
</Provider>,

Check warning on line 35 in src/index.tsx

View workflow job for this annotation

GitHub Actions / Build and Deploy (20.x)

Delete `,`
// eslint-disable-next-line no-undef
document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
Expand Down
Loading

0 comments on commit cab1b8f

Please sign in to comment.