|
2 | 2 | /* eslint-disable jsx-a11y/no-static-element-interactions */ |
3 | 3 | /* eslint-disable react/prop-types */ |
4 | 4 | import React, { useState, useEffect } from 'react'; |
5 | | -import { onHover, onHoverExit, setCurrentTabInApp } from '../../../actions/actions'; |
6 | | -import { useStoreContext } from '../../../store'; |
| 5 | +// import { onHover, onHoverExit, setCurrentTabInApp } from '../../../actions/actions'; |
| 6 | +import { setCurrentTabInApp } from '../../../RTKslices'; |
| 7 | +// import { useStoreContext } from '../../../store'; |
| 8 | +import { useDispatch, useSelector } from 'react-redux'; |
7 | 9 |
|
8 | 10 | /* |
9 | 11 | |
10 | 12 | */ |
11 | 13 |
|
12 | 14 | const RenderingFrequency = (props) => { |
13 | 15 | const perfData = props.data; |
14 | | - const [store, dispatch] = useStoreContext(); |
15 | | - |
| 16 | + // const [store, dispatch] = useStoreContext(); |
| 17 | + const dispatch = useDispatch(); |
16 | 18 | useEffect(() => { |
17 | 19 | dispatch(setCurrentTabInApp('performance-comparison')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'performance-comparison' to facilitate render. |
18 | 20 | }, []); |
@@ -41,7 +43,9 @@ const RenderingFrequency = (props) => { |
41 | 43 |
|
42 | 44 | const ComponentCard = (props): JSX.Element => { |
43 | 45 | const { componentName, stateType, averageRenderTime, renderFrequency, information } = props; |
44 | | - const [{ tabs, currentTab }, dispatch] = useStoreContext(); |
| 46 | + // const [{ tabs, currentTab }, dispatch] = useStoreContext(); |
| 47 | + // const tabs = useSelector((state:any)=>state.main.tabs) |
| 48 | + // const currentTab = useSelector((state:any)=>state.main.currentTab); |
45 | 49 | const [expand, setExpand] = useState(false); |
46 | 50 |
|
47 | 51 | // render time for each component from each snapshot |
|
0 commit comments