Skip to content

Commit

Permalink
fix: 事件钩子执行不稳定
Browse files Browse the repository at this point in the history
  • Loading branch information
lareinayanyu committed Dec 23, 2024
1 parent f9a64b4 commit b51a729
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,10 @@ const useInnerProps = (
}
}

if (!rawEventKeys.length || config.disableTouch) {
return omit(propsRef.current, removeProps)
}

const events = useMemo(() => {
if (!rawEventKeys.length || config.disableTouch) {
return {}
}
const transformedEventKeys = rawEventKeys.reduce((acc: string[], key) => {
if (propsRef.current[key]) {
return acc.concat(eventConfig[key])
Expand All @@ -339,7 +338,7 @@ const useInnerProps = (
})

return events
}, [hashEventKey])
}, [hashEventKey, config.disableTouch])

return extendObject(
{},
Expand Down

0 comments on commit b51a729

Please sign in to comment.