You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the React Native Slider component, and in my application, it is possible for the value that the slider represents to be changed external to the slider. I want to animate those changes so that the slider moves smoothly to the new value rather than jumping.
However, when I try this, I get the error: Cannot read property 'validAttributes' of undefined.
I'm not sure what the right approach to fixing this is, but I'd be happy to take a run at it with some guidance and/or direction.
It seems as though only a few components supply validAttributes, and Slider doesn't seem to be one that does. I'm not sure if it should, or if the code should never get to this point at all.
Steps to Reproduce / Code Snippets
I start by wrapping the Slider with Animated.createAnimatedComponent, and then I pass an Animated.Value into it as the value property.
Here is a pared-down version of my component:
importReactfrom'react'import{Animated,Slider,View}from'react-native'constAnimatedSlider=Animated.createAnimatedComponent(Slider)exportdefaultclassMySliderextendsReact.Component{constructor(props){super(props)const{ value }=propsthis.state={value: newAnimated.Value(value)}}componentWillReceiveProps(nextProps){const{ value }=nextPropsAnimated.timing(this.state.value,{duration: 300,toValue: value}).start()}render(){return(<View><AnimatedSlidermaximumValue={100}minimumValue={0}value={this.state.value}/></View>)}}
RNPlay seems to be down, but if necessary, I can try to put together a standalone runnable example.
Expected Results
I expect that animating the value property of the Slider should work without raising an exception.
Additional Information
React Native version: 0.34.0
Platform(s) (iOS, Android, or both?): iOS
Operating System (macOS, Linux, or Windows?): MacOS 10.11.6
The text was updated successfully, but these errors were encountered:
Issue Description
I am using the React Native Slider component, and in my application, it is possible for the value that the slider represents to be changed external to the slider. I want to animate those changes so that the slider moves smoothly to the new value rather than jumping.
However, when I try this, I get the error:
Cannot read property 'validAttributes' of undefined
.Here is the stacktrace:
I'm not sure what the right approach to fixing this is, but I'd be happy to take a run at it with some guidance and/or direction.
It seems as though only a few components supply
validAttributes
, andSlider
doesn't seem to be one that does. I'm not sure if it should, or if the code should never get to this point at all.Steps to Reproduce / Code Snippets
I start by wrapping the
Slider
withAnimated.createAnimatedComponent
, and then I pass anAnimated.Value
into it as thevalue
property.Here is a pared-down version of my component:
RNPlay seems to be down, but if necessary, I can try to put together a standalone runnable example.
Expected Results
I expect that animating the value property of the Slider should work without raising an exception.
Additional Information
The text was updated successfully, but these errors were encountered: