fix: remove redundant useEffect from TagSelector component (#23406)

This commit is contained in:
lyzno1
2025-08-05 13:15:26 +08:00
committed by GitHub
parent 3b5130b03d
commit 607dfc8be7

View File

@@ -1,5 +1,5 @@
import type { FC } from 'react'
import { useEffect, useMemo, useState } from 'react'
import { useMemo, useState } from 'react'
import { useContext } from 'use-context-selector'
import { useTranslation } from 'react-i18next'
import { useUnmount } from 'ahooks'
@@ -231,11 +231,6 @@ const TagSelector: FC<TagSelectorProps> = ({
}
}
useEffect(() => {
if (tagList.length === 0)
getTagList()
}, [type])
const triggerContent = useMemo(() => {
if (selectedTags?.length)
return selectedTags.filter(selectedTag => tagList.find(tag => tag.id === selectedTag.id)).map(tag => tag.name).join(', ')