Skip to content

Commit 4e60df0

Browse files
author
Chen Oppenhaim
committed
adding ref
1 parent 8632675 commit 4e60df0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { StyleSheet, ScrollView, View, Platform } from 'react-native';
33
import PropTypes from "prop-types";
44
import LinearGradient from "react-native-linear-gradient"
55
const defaultFadeColors = ['rgba(229, 229, 229, 0.18)', 'rgba(206, 201, 201, 0.6)', 'rgba(206, 201, 201, 0.9)'];
6-
export default class RNFadedScrollView extends Component {
6+
class RNFadedScrollView extends Component {
77

88
constructor(props) {
99
super(props);
@@ -131,6 +131,7 @@ export default class RNFadedScrollView extends Component {
131131
{(this.state.allowStartFade && this.props.allowDivider) && this.getDivider()}
132132
<ScrollView
133133
{...this.props}
134+
ref={this.props.innerRef}
134135
style={[styles.scrollViewStyle, this.props.style]}
135136
onContentSizeChange={this.onContentSizeChange}
136137
scrollEventThrottle={16}
@@ -175,3 +176,5 @@ RNFadedScrollView.defaultProps = {
175176
allowDivider: false,
176177
isRtl: false
177178
}
179+
180+
export default React.forwardRef((props, ref) => <RNFadedScrollView {...props} innerRef={ref} />);

0 commit comments

Comments
 (0)