mirror of
https://github.com/status-im/react-native.git
synced 2025-01-16 04:24:15 +00:00
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:
parent
904afaf8c7
commit
7555ae13d1
@ -28,7 +28,7 @@ import com.facebook.react.bridge.ReadableMap;
|
|||||||
mMin = config.getDouble("min");
|
mMin = config.getDouble("min");
|
||||||
mMax = config.getDouble("max");
|
mMax = config.getDouble("max");
|
||||||
|
|
||||||
mValue = mLastValue = getInputNodeValue();
|
mValue = mLastValue = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user