We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7e26a5 commit ccf6217Copy full SHA for ccf6217
custom-implementation/src/components/theme-switch.tsx
@@ -9,8 +9,11 @@ export const ThemeSwitch = () => {
9
useEffect(() => {
10
const listenToPopstate = () => {
11
const winPath = window.location.pathname
12
+ console.log('listenToPopstate called', winPath)
13
setPath(winPath)
14
}
15
+
16
+ console.log('listenToPopstate added')
17
window.addEventListener('popstate', listenToPopstate)
18
return () => {
19
window.removeEventListener('popstate', listenToPopstate)
@@ -19,6 +22,7 @@ export const ThemeSwitch = () => {
22
20
23
21
24
const beta = path.split('/').includes('beta')
25
+ console.log('path changed', path, beta)
26
setSelected(beta ? 'beta' : 'public')
27
}, [path])
28
0 commit comments