Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#8832 from PublicParadise/rn-scrollto
Browse files Browse the repository at this point in the history
Adding scrollTo to react-native's ScrollViewStatic
  • Loading branch information
vvakame committed Apr 6, 2016
2 parents 513510a + 870676f commit d3cc211
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion react-native/react-native.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2768,7 +2768,21 @@ declare namespace __React {
}

interface ScrollViewStatic extends React.ComponentClass<ScrollViewProps> {

/**
* 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;
}


Expand Down

0 comments on commit d3cc211

Please sign in to comment.