From 92baa0dcf093d23b7bed417df2c15fc6e2fd1b6a Mon Sep 17 00:00:00 2001 From: Luis Miguel Alvarado Date: Thu, 11 Jul 2019 09:53:28 -0400 Subject: [PATCH 1/2] delete deprecated duration prop --- docs/scrollview.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/docs/scrollview.md b/docs/scrollview.md index b7547e42295..bd456ac57bf 100644 --- a/docs/scrollview.md +++ b/docs/scrollview.md @@ -718,24 +718,18 @@ Displays the scroll indicators momentarily. ```javascript scrollTo( - ([y]: number), - object, - ([x]: number), - ([animated]: boolean), - ([duration]: number), + y?: number | {x?: number, y?: number, animated?: boolean}, + x?: number, + animated?: boolean, ); ``` -Scrolls to a given x, y offset, either immediately, with a smooth animation, or, for Android only, a custom animation duration time. +Scrolls to a given x, y offset, either immediately, with a smooth animation. Example: `scrollTo({x: 0, y: 0, animated: true})` -Example with duration (Android only): - -`scrollTo({x: 0, y: 0, duration: 500})` - Note: The weird function signature is due to the fact that, for historical reasons, the function also accepts separate arguments as an alternative to the options object. This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. --- From c7c6adc12fb98164ecb80239c9849e331d7a450c Mon Sep 17 00:00:00 2001 From: Luis Miguel Alvarado Date: Thu, 11 Jul 2019 10:33:17 -0400 Subject: [PATCH 2/2] change scrollTo parameters --- docs/scrollview.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/scrollview.md b/docs/scrollview.md index bd456ac57bf..a3a1b941666 100644 --- a/docs/scrollview.md +++ b/docs/scrollview.md @@ -718,9 +718,9 @@ Displays the scroll indicators momentarily. ```javascript scrollTo( - y?: number | {x?: number, y?: number, animated?: boolean}, - x?: number, - animated?: boolean, + options?: {x?: number, y?: number, animated?: boolean} | number, + deprecatedX?: number, + deprecatedAnimated?: boolean, ); ```