File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { diff, formatters } from 'jsondiffpatch';
3
3
import ReactHtmlParser from 'react-html-parser' ;
4
4
import { useStoreContext } from '../store' ;
5
5
import { DiffProps , StatelessCleaning } from '../FrontendTypes' ;
6
+ import { useSelector } from 'react-redux' ;
6
7
7
8
/**
8
9
* Displays tree showing two specific versions of tree:
@@ -16,8 +17,9 @@ function Diff(props: DiffProps): JSX.Element {
16
17
snapshot, // snapshot from 'tabs[currentTab]' object in 'MainContainer'
17
18
show // boolean that is dependent on the 'Route' path; true if 'Route' path === '/diffRaw'
18
19
} = props ;
19
- const [ mainState ] = useStoreContext ( ) ; // useStoreContext() returns our global state object (which was initialized as 'initialState' in 'App.tsx')
20
- const { currentTab, tabs } = mainState ; // 'currentTab' (type: number) and 'tabs' (type: object) are destructured from 'mainState'
20
+ // const [mainState] = useStoreContext(); // useStoreContext() returns our global state object (which was initialized as 'initialState' in 'App.tsx')
21
+ // const { currentTab, tabs } = mainState; // 'currentTab' (type: number) and 'tabs' (type: object) are destructured from 'mainState'
22
+ const { currentTab, tabs } = useSelector ( ( state : any ) => state . main ) ;
21
23
const { snapshots, viewIndex, sliderIndex } = tabs [ currentTab ] ;
22
24
23
25
let previous : unknown // = (viewIndex !== -1) ? snapshots[viewIndex - 1] : previous = snapshots[sliderIndex - 1]
You can’t perform that action at this time.
0 commit comments