From c7a79a62fa4c4e5c61af8b7d8e647deefde9636f Mon Sep 17 00:00:00 2001 From: "satyajit.happy" Date: Sun, 1 Sep 2019 12:43:03 +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 037f4176..09586186 100755 --- a/packages/stack/src/views/Stack/Card.tsx +++ b/packages/stack/src/views/Stack/Card.tsx @@ -254,7 +254,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) + ) ); } }