From adaeba296e7b8a9937ee3a277ddba04d12e7c7bb Mon Sep 17 00:00:00 2001 From: Mehdi Mulani Date: Tue, 11 Sep 2018 11:29:35 -0700 Subject: [PATCH] Fix buildStyleInterpolator Summary: This relied on NaN being turned into null (through JSON.stringify), which would then be handled by Yoga gracefully. But in some cases we do not call JSON.stringify and thus pass NaN directly to Yoga causing a problem. Reviewed By: fkgozali Differential Revision: D9764488 fbshipit-source-id: 021c9ffafba8f9bcef2476756a12df33c367bcb1 --- Libraries/Utilities/buildStyleInterpolator.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/Utilities/buildStyleInterpolator.js b/Libraries/Utilities/buildStyleInterpolator.js index c316409876c..1e17dc1b8f0 100644 --- a/Libraries/Utilities/buildStyleInterpolator.js +++ b/Libraries/Utilities/buildStyleInterpolator.js @@ -54,6 +54,9 @@ const computeNextValLinear = function(anim, from, to, value) { if (hasRoundRatio) { nextVal = Math.round(roundRatio * nextVal) / roundRatio; } + if (!isFinite(nextVal)) { + nextVal = null; + } return nextVal; };