fix: show subheader on refresh
This commit is contained in:
parent
8405d23dee
commit
dc28ece83d
1 changed files with 1 additions and 2 deletions
|
|
@ -33,9 +33,8 @@ const Link = ({
|
||||||
}) => {
|
}) => {
|
||||||
const [location] = useLocation()
|
const [location] = useLocation()
|
||||||
const [isActive] = useRoute(props.to)
|
const [isActive] = useRoute(props.to)
|
||||||
if (isActive) setActive(item)
|
|
||||||
|
|
||||||
const isParentActive = isParent && location.startsWith(props.to)
|
const isParentActive = isParent && location.startsWith(props.to)
|
||||||
|
if (isActive || isParentActive) setActive(item)
|
||||||
|
|
||||||
const classNames = classnames({
|
const classNames = classnames({
|
||||||
[className]: true,
|
[className]: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue