diff --git a/Examples/UIExplorer/js/RTLExample.js b/Examples/UIExplorer/js/RTLExample.js index 5298dc5f6a99e0..74f31b0ea214aa 100644 --- a/Examples/UIExplorer/js/RTLExample.js +++ b/Examples/UIExplorer/js/RTLExample.js @@ -47,8 +47,6 @@ const { const UIExplorerPage = require('./UIExplorerPage'); const UIExplorerBlock = require('./UIExplorerBlock'); -const AnimatedImage = Animated.createAnimatedComponent(Image); - type State = { toggleStatus: any, pan: Object, @@ -116,7 +114,7 @@ function AnimationBlock(props) { return ( - diff --git a/Libraries/Animated/src/AnimatedImplementation.js b/Libraries/Animated/src/AnimatedImplementation.js index 4182a8aac37549..7fb99069c559b8 100644 --- a/Libraries/Animated/src/AnimatedImplementation.js +++ b/Libraries/Animated/src/AnimatedImplementation.js @@ -1715,6 +1715,12 @@ function createAnimatedComponent(Component: any): any { var callback = () => { if (this._component.setNativeProps) { if (!this._propsAnimated.__isNative) { + if (this._component.viewConfig == null) { + var ctor = this._component.constructor; + var componentName = ctor.displayName || ctor.name || ''; + throw new Error(componentName + ' "viewConfig" is not defined.'); + } + this._component.setNativeProps( this._propsAnimated.__getAnimatedValue() ); diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 032d374ba58182..2db7392b805ea7 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -13,6 +13,7 @@ var Image = require('Image'); var NativeMethodsMixin = require('react/lib/NativeMethodsMixin'); +var ReactNativeViewAttributes = require('ReactNativeViewAttributes'); var Platform = require('Platform'); var PropTypes = require('react/lib/ReactPropTypes'); var React = require('React'); @@ -139,6 +140,14 @@ var Slider = React.createClass({ }; }, + viewConfig: { + uiViewClassName: 'RCTSlider', + validAttributes: { + ...ReactNativeViewAttributes.RCTView, + value: true + } + }, + render: function() { const {style, onValueChange, onSlidingComplete, ...props} = this.props; props.style = [styles.slider, style];