File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
- import React , { useEffect } from "react" ;
1
+ import React from "react" ;
2
2
import history from "../history" ;
3
3
import { Router , Route } from 'react-router-dom' ;
4
4
import log from "loglevel"
@@ -14,6 +14,7 @@ import ShoppingBag from "./routes/shoppingBag";
14
14
15
15
const App = ( ) => {
16
16
log . info ( `[App]: Rendering App Component window` )
17
+
17
18
return (
18
19
< Router history = { history } >
19
20
< Route path = "/" component = { NavBar } />
Original file line number Diff line number Diff line change @@ -41,9 +41,17 @@ function Product() {
41
41
useEffect ( ( ) => {
42
42
log . info ( `[Product] Component did mount...` )
43
43
44
+ const reloadPage = ( ) => {
45
+ window . location . reload ( )
46
+ }
47
+
48
+ window . addEventListener ( "popstate" , reloadPage ) ;
49
+
44
50
return ( ) => {
45
51
log . info ( `[Product] Component will unmount...` )
46
52
53
+ window . removeEventListener ( "popstate" , reloadPage ) ;
54
+
47
55
dispatch ( {
48
56
type : SAVE_QUERY_STATUS ,
49
57
payload : null
You can’t perform that action at this time.
0 commit comments