You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/app/components/SwitchApp.tsx
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,10 @@
1
1
importReactfrom'react';
2
2
importSelectfrom'react-select';
3
-
import{useStoreContext}from'../store';
4
-
import{setTab}from'../actions/actions';
3
+
//commented out for RTK
4
+
// import { useStoreContext } from '../store';
5
+
import{setTab}from'../RTKslices';
6
+
//importing these methods for RTK
7
+
import{useSelector,useDispatch}from'react-redux';
5
8
6
9
/*
7
10
This is the dropdown menu on the left column above the 'clear' button and the state snapshots list. It allows us to switch between which website/application we are currently working on.
@@ -10,8 +13,13 @@ import { setTab } from '../actions/actions';
10
13
*/
11
14
12
15
constSwitchAppDropdown=(): JSX.Element=>{
13
-
const[{ currentTab, tabs },dispatch]=useStoreContext();// we destructure the returned context object from the invocation of the useStoreContext function. Properties not found on the initialState object (dispatch) are from the useReducer function invocation in the App component
14
-
16
+
//commented out to implement RTK
17
+
// const [{ currentTab, tabs }, dispatch] = useStoreContext(); // we destructure the returned context object from the invocation of the useStoreContext function. Properties not found on the initialState object (dispatch) are from the useReducer function invocation in the App component
18
+
//here we are adding useSelector and useDispatch for RTK state conversion
0 commit comments