我正在尝试使用 Typescript 和 useCallback,但我遇到了这个错误
Expected 0 arguments, but got 1
这是我的代码
const searchFriends = useCallback(() => (filterValue: string): void => {
if (dataState.length <= INITIAL_FRIENDS_API_REQUEST) fetchAllFriends()
const filterValueInsensitive = filterValue.toLowerCase()
const filtered = dataState.filter((friend: Friends) => {
return friend.displayName?.toLowerCase().includes(filterValueInsensitive)
})
setFriendsDisplayState(filtered)
}, [dataState,fetchAllFriends])
const handleChangeSearchInput = (
e: React.ChangeEvent<HTMLInputElement>
): void => searchFriends(e.currentTarget.value) // ERROR here "Expected 0 arguments, but got 1"
知道如何解决吗?