From a75a2fe1a72cae9e032bb3d4ef176480f6447ed6 Mon Sep 17 00:00:00 2001 From: YaroslavLys <74725159+YaroslavLys@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:27:32 +0300 Subject: [PATCH] Updated redux and redux toolkit (#2248) * updated @typescript-eslint/eslint-plugin and @typescript-eslint/parser * fixed eslint errors * Updated redux and redux toolkit * Expanded workflow triggers to include feature branches #2186 (#2187) * Expanded workflow triggers to include feature branches #2186 * Optimization of workflow process * delete sonar.branch.name (#2232) * Fixed sonar issue --------- Co-authored-by: YaroslavChuiko Co-authored-by: Olenka Hryk Co-authored-by: Yaroslav Chuiko <32570823+YaroslavChuiko@users.noreply.github.com> --- package.json | 7 +++++-- src/redux/features/snackbarSlice.ts | 5 ++--- src/redux/store.ts | 4 ---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 99d27e7777..d8e5d33adb 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@mui/icons-material": "^5.14.16", "@mui/material": "^5.14.16", "@mui/x-date-pickers": "^7.11.0", - "@reduxjs/toolkit": "^1.9.7", + "@reduxjs/toolkit": "^2.2.7", "@tinymce/tinymce-react": "^5.1.1", "allotment": "^1.19.3", "axios": "^1.6.0", @@ -27,7 +27,7 @@ "react-dom": "^18.2.0", "react-i18next": "^15.0.0", "react-player": "^2.16.0", - "react-redux": "^8.1.3", + "react-redux": "^9.1.2", "react-router-dom": "^6.18.0", "react-swipeable-views": "^0.14.0", "react-transition-group": "^4.4.5", @@ -36,6 +36,9 @@ "vite-plugin-svgr": "^4.1.0", "web-vitals": "^4.2.2" }, + "overrides": { + "redux": "^5.0.0" + }, "devDependencies": { "@babel/core": "^7.23.2", "@eslint/compat": "^1.1.1", diff --git a/src/redux/features/snackbarSlice.ts b/src/redux/features/snackbarSlice.ts index 337f1dfb9d..cd02ddd627 100644 --- a/src/redux/features/snackbarSlice.ts +++ b/src/redux/features/snackbarSlice.ts @@ -1,13 +1,12 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit' +import { createSlice, PayloadAction, Draft } from '@reduxjs/toolkit' import { AlertColor } from '@mui/material/Alert' import { sliceNames } from '~/redux/redux.constants' import { RootState } from '~/redux/store' import { TOptions } from 'i18next/typescript/options' -import { WritableDraft } from 'immer/dist/internal' interface ExtendedSnackbarMessage { text: string - options: WritableDraft + options: Draft } type SnackbarMessage = string | ExtendedSnackbarMessage diff --git a/src/redux/store.ts b/src/redux/store.ts index 4a2a053a82..3bb90c6d75 100644 --- a/src/redux/store.ts +++ b/src/redux/store.ts @@ -1,6 +1,5 @@ import { configureStore } from '@reduxjs/toolkit' import { setupListeners } from '@reduxjs/toolkit/query/react' -import { ToolkitStore } from '@reduxjs/toolkit/dist/configureStore' import { appApi } from '~/redux/apiSlice' import appMainReducer from '~/redux/reducer' @@ -24,6 +23,3 @@ setupListeners(store.dispatch) export type RootState = ReturnType export type AppDispatch = typeof store.dispatch -export interface Store extends ToolkitStore { - dispatch: AppDispatch -}