Throw error when setting value of AnimatedValue to undefined
Summary: Changelog: [Internal] Throw error when setting Animated value to undefined. Background: ReadableNativeMap removes keys that have undefined values. Somewhere some animation is setting the value to be undefined. Follow up: Find a way to warn generally that undefined values are being set for maps that become ReadableNativeMaps Reviewed By: JoshuaGross Differential Revision: D20169325 fbshipit-source-id: 404b727dc238703ebe5f71a0939340d5f1b3b211
This commit is contained in:
Родитель
0569d4c431
Коммит
b8715dc31c
|
@ -239,6 +239,10 @@ class AnimatedValue extends AnimatedWithChildren {
|
|||
}
|
||||
|
||||
_updateValue(value: number, flush: boolean): void {
|
||||
if (value === undefined) {
|
||||
throw new Error('Attempting to set value to undefined');
|
||||
}
|
||||
|
||||
this._value = value;
|
||||
if (flush) {
|
||||
_flush(this);
|
||||
|
|
Загрузка…
Ссылка в новой задаче