From e08ad8fe66a46b413735657824320ca3d4ffdfa2 Mon Sep 17 00:00:00 2001 From: "satyajit.happy" Date: Sun, 22 Sep 2019 01:27:14 +0200 Subject: [PATCH] fix: defer running the animation to next frame --- packages/stack/src/views/Stack/Card.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/stack/src/views/Stack/Card.tsx b/packages/stack/src/views/Stack/Card.tsx index dfa0613a..9cde2148 100755 --- a/packages/stack/src/views/Stack/Card.tsx +++ b/packages/stack/src/views/Stack/Card.tsx @@ -261,7 +261,9 @@ export default class Card extends React.Component { // If the style updates during render, setting the value here doesn't work // We need to defer it a bit so the animation starts properly requestAnimationFrame(() => - this.isClosing.setValue(closing ? TRUE : FALSE) + requestAnimationFrame(() => + this.isClosing.setValue(closing ? TRUE : FALSE) + ) ); } }