Skip to content

Commit

Permalink
feat(search): 去掉条件判断
Browse files Browse the repository at this point in the history
  • Loading branch information
xiamiao committed Jun 28, 2024
1 parent 6fa0d72 commit 0440e5b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/ui/search/src/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ export const Search = forwardRef<HTMLInputElement | null, SearchProps>(
},
ref
) => {
const transformedData = useMemo(() => {
if (data) return transformData(data, fieldNames)
else return data
}, [data, fieldNames])
const transformedData = useMemo(() => transformData(data, fieldNames), [data, fieldNames])

const [visible, setVisible] = useState<boolean>(false)
const targetElRef = useRef<HTMLDivElement | null>(null)
Expand Down

0 comments on commit 0440e5b

Please sign in to comment.