fix(core): forwardRef in count down render (#4086)

This commit is contained in:
Alex Yang
2023-08-31 18:37:56 -05:00
committed by GitHub
parent 06d5ecd597
commit 1e30a3c7fe

View File

@@ -13,8 +13,12 @@ const formatTime = (time: number): string => {
export const CountDownRender = forwardRef<
HTMLDivElement,
{ timeLeft: number } & HTMLAttributes<HTMLDivElement>
>(({ timeLeft, ...props }) => {
return <div {...props}>{formatTime(timeLeft)}</div>;
>(({ timeLeft, ...props }, ref) => {
return (
<div {...props} ref={ref}>
{formatTime(timeLeft)}
</div>
);
});
CountDownRender.displayName = 'CountDownRender';