diff --git a/Elements/Button.tsx b/Elements/Button.tsx index d52a7d1..de63e31 100644 --- a/Elements/Button.tsx +++ b/Elements/Button.tsx @@ -1,7 +1,7 @@ import { Button as AntButton } from 'antd'; import type { BaseButtonProps } from 'antd/lib/button/button'; -import { throttle } from 'radash/dist/curry'; import type { FC } from 'react'; +import { useThrottledCallback } from 'use-debounce'; import type { BaseElementProps } from './types'; type ElementProps = { @@ -17,12 +17,9 @@ export default (function Button({ text, ...props }: BaseElementProps & ElementProps) { - const throttledAction = throttle( - { - interval: 1200, - }, - action - ); + const throttledAction = useThrottledCallback(action, 1200, { + trailing: false, + }); return (