Skip to content

Commit

Permalink
Update API docs for scrollEventThrottle (facebook#42185)
Browse files Browse the repository at this point in the history
Summary:

We've rolled out some changes to the behavior here, mainly that throttling no longer happens by default on iOS.

This updates the documentation, in concert with facebook/react-native-website#3971

Changelog:
[General][Changed] - Update API docs for scrollEventThrottle

Reviewed By: javache

Differential Revision: D52516092
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Jan 11, 2024
1 parent 822bf52 commit 468b310
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,12 +481,12 @@ export interface ScrollViewPropsIOS {
pinchGestureEnabled?: boolean | undefined;

/**
* This controls how often the scroll event will be fired while scrolling (as a time interval in ms).
* A lower number yields better accuracy for code that is tracking the scroll position,
* but can lead to scroll performance problems due to the volume of information being sent over the bridge.
* The default value is zero, which means the scroll event will be sent only once each time the view is scrolled.
* Limits how often scroll events will be fired while scrolling, specified as
* a time interval in ms. This may be useful when expensive work is performed
* in response to scrolling. Values <= `16` will disable throttling,
* regardless of the refresh rate of the device.
*/
scrollEventThrottle?: number | undefined; // null
scrollEventThrottle?: number | undefined;

/**
* The amount by which the scroll view indicators are inset from the edges of the scroll view.
Expand Down Expand Up @@ -663,7 +663,6 @@ export interface ScrollViewProps

/**
* Fires at most once per frame during scrolling.
* The frequency of the events can be contolled using the scrollEventThrottle prop.
*/
onScroll?:
| ((event: NativeSyntheticEvent<NativeScrollEvent>) => void)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ export type Props = $ReadOnly<{|
onMomentumScrollEnd?: ?(event: ScrollEvent) => void,

/**
* Fires at most once per frame during scrolling. The frequency of the
* events can be controlled using the `scrollEventThrottle` prop.
* Fires at most once per frame during scrolling.
*/
onScroll?: ?(event: ScrollEvent) => void,
/**
Expand Down Expand Up @@ -556,19 +555,10 @@ export type Props = $ReadOnly<{|
*/
scrollEnabled?: ?boolean,
/**
* This controls how often the scroll event will be fired while scrolling
* (as a time interval in ms). A lower number yields better accuracy for code
* that is tracking the scroll position, but can lead to scroll performance
* problems due to the volume of information being send over the bridge.
*
* Values between 0 and 17ms indicate 60fps updates are needed and throttling
* will be disabled.
*
* If you do not need precise scroll position tracking, set this value higher
* to limit the information being sent across the bridge.
*
* The default value is zero, which results in the scroll event being sent only
* once each time the view is scrolled.
* Limits how often scroll events will be fired while scrolling, specified as
* a time interval in ms. This may be useful when expensive work is performed
* in response to scrolling. Values <= `16` will disable throttling,
* regardless of the refresh rate of the device.
*/
scrollEventThrottle?: ?number,
/**
Expand Down

0 comments on commit 468b310

Please sign in to comment.