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
This commit is contained in:
Mehdi Mulani 2018-09-11 11:29:35 -07:00 committed by Facebook Github Bot
parent 09e6e6c329
commit adaeba296e
1 changed files with 3 additions and 0 deletions

View File

@ -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;
};