Fix a potential reference error in bottombarweb (#1600)

zio/stable
Paul Frazee 2023-10-03 19:55:44 -07:00 committed by GitHub
parent 6598fca79d
commit 847d4d19b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -109,7 +109,12 @@ const NavItem: React.FC<{
href: string href: string
routeName: string routeName: string
}> = ({children, href, routeName}) => { }> = ({children, href, routeName}) => {
const currentRoute = useNavigationState(getCurrentRoute) const currentRoute = useNavigationState(state => {
if (!state) {
return {name: 'Home'}
}
return getCurrentRoute(state)
})
const store = useStores() const store = useStores()
const isActive = const isActive =
currentRoute.name === 'Profile' currentRoute.name === 'Profile'