Hussian Shaik
Hussian Shaik

Reputation: 2685

scrollTo(y,x,animated ) is deprecated in react-native using ScrollView

Hai while i am using ScrollView in react-native, I got some warning messages like scrollTo(y,x,animated) is deprecated, Below is the screenShot images for both android and IOS.

enter image description here

can you any one give me suggestions that how to solve this type of warnings i got this while using react-native version:0.21. Any help much appreciated

Upvotes: 4

Views: 2366

Answers (1)

Ivan Chernykh
Ivan Chernykh

Reputation: 42166

They changed the syntax, now scrollTo gets only one Object argument. Use it like this now:

 scrollView.scrollTo({ y: newY, animated: true });

Upvotes: 9

Related Questions