fix: toggling AppDetailNav causes unnecessary component rerenders (#3718)

This commit is contained in:
legao 2024-04-24 04:07:28 +00:00 • committed by GitHub
commit 40e36e9b52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 314 additions and 276 deletions

View file

@ -31,7 +31,7 @@ const Nav = ({
onLoadmore,
isApp,
}: INavProps) => {
const { setAppDetail } = useAppStore()
const setAppDetail = useAppStore(state => state.setAppDetail)
const [hovered, setHovered] = useState(false)
const segment = useSelectedLayoutSegment()
const isActived = Array.isArray(activeSegment) ? activeSegment.includes(segment!) : segment === activeSegment