Init diffclamp node at 0 to avoid problems with NaN

Summary:
Some nodes have a value of NaN initially so if we assign the value of the input in the constructor it is possible we get NaN as a value and then it will break when trying to update the value. Initializing at 0 is actually fine with this node since it will get updated properly in the `update` method.

**Test plan**
Tested in an app that uses native animated diffclamp where I noticed the issue. Made sure this change fixed it.
Closes https://github.com/facebook/react-native/pull/12279

Differential Revision: D4527866

fbshipit-source-id: add3fc0d86ffcf4ddcd01ff3251f2373eeaa2cf5
This commit is contained in:
Janic Duplessis 2017-02-08 01:29:00 -08:00 committed by Facebook Github Bot
parent 904afaf8c7
commit 7555ae13d1
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ import com.facebook.react.bridge.ReadableMap;
mMin = config.getDouble("min");
mMax = config.getDouble("max");
mValue = mLastValue = getInputNodeValue();
mValue = mLastValue = 0;
}
@Override