Skip to content

Commit 7cf29ec

Browse files
author
Malik Kawee
committed
# scrollEventThrottle is not accepted as a prop
# updated README
1 parent 8f425f1 commit 7cf29ec

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Vertical Scroll | Horizontal Scroll
55
:-------------------------:|:-------------------------:
66
![](assets/vertical.gif) | ![](assets/horizontal.gif)
77

8+
# Sponsor
9+
<a href="https://www.buymeacoffee.com/malikkawee" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
10+
811
## Installation
912
This library relies on [react-native-linear-gradient](https://github.com/react-native-community/react-native-linear-gradient). Follow setup instructions of linear gradient.
1013

@@ -26,6 +29,7 @@ This library accepts all the props of [ScrollView](https://reactnative.dev/docs/
2629
| fadeSize | Fade size i.e( width incase of horizontal and height incase of vertical ScrollView) | 20 | Number |
2730
| fadeColors | Colors for fade effect | ['rgba(229, 229, 229, 0.18)', 'rgba(206, 201, 201, 0.6)', 'rgba(206, 201, 201, 0.9)'] | Array |
2831
| scrollThreshold | Threshold to control fade hide/show when it reaches start or end | 10 | Number |
32+
| scrollEventThrottle | This controls how often the scroll event will be fired while scrolling (as a time interval in ms) | 16 | Number |
2933
| allowDivider | Allow divider at fade end. | false | Boolean |
3034
| isRtl | For RTL Layouts | false | Boolean |
3135
| onContentSizeChange | onContentSizeChange call back added, function will return contentWidth and contentHeight | | Function |
@@ -39,4 +43,4 @@ For styling pass these props.
3943
| Name | Callback param | Description |
4044
|---------------------------|------------------------------------------|-------------|
4145
| isCloseToEnd | Boolean | if scroll is close to end or not. |
42-
| isCloseToStart | Boolean | if scroll is close to start or not. |
46+
| isCloseToStart | Boolean | if scroll is close to start or not. |

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class RNFadedScrollView extends Component {
134134
ref={this.props.innerRef}
135135
style={[styles.scrollViewStyle, this.props.style]}
136136
onContentSizeChange={this.onContentSizeChange}
137-
scrollEventThrottle={16}
137+
scrollEventThrottle={this.props.scrollEventThrottle}
138138
onScroll={this.onScrolled}
139139
>
140140
{this.props.children}
@@ -166,7 +166,8 @@ RNFadedScrollView.propTypes = {
166166
scrollThreshold: PropTypes.number,
167167
allowDivider: PropTypes.bool,
168168
isRtl: PropTypes.bool,
169-
onContentSizeChange: PropTypes.func
169+
onContentSizeChange: PropTypes.func,
170+
scrollEventThrottle: PropTypes.number
170171
}
171172
RNFadedScrollView.defaultProps = {
172173
allowStartFade: false,
@@ -175,7 +176,8 @@ RNFadedScrollView.defaultProps = {
175176
fadeColors: defaultFadeColors,
176177
scrollThreshold: 10,
177178
allowDivider: false,
178-
isRtl: false
179+
isRtl: false,
180+
scrollEventThrottle: 16
179181
}
180182

181183
export default React.forwardRef((props, ref) => <RNFadedScrollView {...props} innerRef={ref} />)

0 commit comments

Comments
 (0)