Skip to content

Commit 116f4eb

Browse files
committed
Move viewConfig check to setNativeProps
1 parent 50d1828 commit 116f4eb

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Libraries/Animated/src/AnimatedImplementation.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,12 +1747,6 @@ function createAnimatedComponent(Component: any): any {
17471747
var callback = () => {
17481748
if (this._component.setNativeProps) {
17491749
if (!this._propsAnimated.__isNative) {
1750-
if (this._component.viewConfig == null) {
1751-
var ctor = this._component.constructor;
1752-
var componentName = ctor.displayName || ctor.name || '<Unknown Component>';
1753-
throw new Error(componentName + ' "viewConfig" is not defined.');
1754-
}
1755-
17561750
this._component.setNativeProps(
17571751
this._propsAnimated.__getAnimatedValue()
17581752
);

Libraries/Renderer/src/renderers/native/NativeMethodsMixin.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ var NativeMethodsMixin = {
139139
* Manipulation](docs/direct-manipulation.html)).
140140
*/
141141
setNativeProps: function(nativeProps: Object) {
142+
if (!this.viewConfig) {
143+
var ctor = this.constructor;
144+
var componentName = ctor.displayName || ctor.name || '<Unknown Component>';
145+
throw new Error(componentName + ' "viewConfig" is not defined.');
146+
}
147+
142148
if (__DEV__) {
143149
warnForStyleProps(nativeProps, this.viewConfig.validAttributes);
144150
}

0 commit comments

Comments
 (0)