fix: show subheader on refresh

This commit is contained in:
Rafael Taranto 2025-05-18 09:27:14 +01:00
parent 8405d23dee
commit dc28ece83d

View file

@ -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,