8000 fix: CSidebarNavDropdown: place useLocation hook in try/catch block · oflenake/coreui-react@2365228 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2365228

Browse files
committed
fix: CSidebarNavDropdown: place useLocation hook in try/catch block
1 parent bd0903a commit 2365228

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/template/CSidebarNavDropdown.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ const CSidebarNavDropdown = props => {
4545

4646
const { dropdownMode } = useContext(Context)
4747

48-
const path = useLocation().pathname
48+
let path = ''
49+
try {
50+
path = useLocation().pathname
51+
} catch (e) {}
52+
4953
useMemo(()=>{
5054
if (dropdownMode === 'close') {
5155
setIsOpen(false)

0 commit comments

Comments
 (0)
0