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
//here we are adding useSelector and useDispatch for RTK state conversion
33
+
constdispatch=useDispatch();
34
+
30
35
// We destructure the 'props' that were passed into this component
31
36
const{
32
37
selected,// boolean on whether the current index is the same as the viewIndex in 'ActionContainer'
33
38
last,// boolean on (whether the view index is less than 0) AND if (the index is the same as the last snapshot's index value in hierarchyArr) in 'ActionContainer'
34
39
index,// from snapshot.index in "ActionContainer's" 'hierarchyArr'
35
40
sliderIndex,// from tabs[currentTab] object in 'ActionContainer'
36
-
dispatch,
41
+
//commented out dispatch that was prop drilled as conversion to RTX might invalidate need for prop drilling to access dispatch
42
+
// dispatch,
37
43
displayName,// from snapshot.displayName in "ActionContainer's" 'hierarchyArr'
38
44
componentData,// from snapshot.componentData in "ActionContainer's" 'hierarchyArr'
39
45
viewIndex,// from tabs[currentTab] object in 'ActionContainer'
const{ snapshotsLength }=props;// destructure props to get our total number of snapshots
32
-
const[{ tabs, currentTab },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
33
-
const{ currLocation }=tabs[currentTab];// we destructure the currentTab object
34
+
// const [{ tabs, currentTab }, 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
34
35
const[sliderIndex,setSliderIndex]=useState(0);// create a local state 'sliderIndex' and set it to 0.
const{ Steps }=require('intro.js-react');//Must be required in. This enables compatibility with TS. If imported in, throws ts error of not rendering steps as a class component correctly. The package 'intro.js-react' is small React wrapper around Intro.js. The wrapper provides support for both steps and hints. https://introjs.com/docs/
// This updates the steps so that they can target dynamically rendered elements
44
48
constonChangeHandler=(currentStepIndex: number)=>{// takes in the current step and updates the tab[currentTab]'s seriesSavedStatus based on conditions and updates the element associated with the step.
0 commit comments