From 4952d948ec8647a705ec905074c51e2559f4f77f Mon Sep 17 00:00:00 2001 From: Fadi Khadra Date: Tue, 1 Nov 2022 08:38:37 +0100 Subject: [PATCH] Revert "alias requestAnimationFrame" This reverts commit 3844fdd15e58d88058711fba71be08b643b18279. --- src/utils/collapseToast.ts | 6 +++--- src/utils/constant.ts | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/utils/collapseToast.ts b/src/utils/collapseToast.ts index afe4187e..71ce014d 100644 --- a/src/utils/collapseToast.ts +++ b/src/utils/collapseToast.ts @@ -1,4 +1,4 @@ -import { Default, raf } from './constant'; +import { Default } from './constant'; /** * Used to collapse toast after exit animation @@ -10,12 +10,12 @@ export function collapseToast( ) { const { scrollHeight, style } = node; - raf(() => { + requestAnimationFrame(() => { style.minHeight = 'initial'; style.height = scrollHeight + 'px'; style.transition = `all ${duration}ms`; - raf(() => { + requestAnimationFrame(() => { style.height = '0'; style.padding = '0'; style.margin = '0'; diff --git a/src/utils/constant.ts b/src/utils/constant.ts index 0b6b4f1b..75556ca2 100644 --- a/src/utils/constant.ts +++ b/src/utils/constant.ts @@ -10,8 +10,6 @@ type KeyOfPosition = type KeyOfType = 'INFO' | 'SUCCESS' | 'WARNING' | 'ERROR' | 'DEFAULT'; -export const raf = requestAnimationFrame - /** * @deprecated */