From 870676f6e21c10a2a23acfa285f79a66f7c74957 Mon Sep 17 00:00:00 2001 From: Bernd Paradies Date: Sun, 3 Apr 2016 20:32:13 -0700 Subject: [PATCH] Adding scrollTo to react-native's ScrollViewStatic --- react-native/react-native.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/react-native/react-native.d.ts b/react-native/react-native.d.ts index 617b9100a0..b7f19c4489 100644 --- a/react-native/react-native.d.ts +++ b/react-native/react-native.d.ts @@ -2768,7 +2768,21 @@ declare namespace __React { } interface ScrollViewStatic extends React.ComponentClass { - + /** + * Scrolls to a given x, y offset, either immediately or with a smooth animation. + * Syntax: + * + * scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true}) + * + * Note: The weird argument signature is due to the fact that, for historical reasons, + * the function also accepts separate arguments as as alternative to the options object. + * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. + */ + scrollTo( + y?: number | { x?: number, y?: number, animated?: boolean }, + x?: number, + animated?: boolean + ): void; }