Skip to content

Commit

Permalink
fix: add missing forwardRef to ScrollViewWithContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Pader committed Jan 19, 2023
1 parent 43cb545 commit c4e8ea8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/ScrollViewWithContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ScrollViewWithContext extends React.Component {
this.state = {
contentOffsetY: 0,
};
this.scrollViewRef = React.createRef(null);
this.scrollViewRef = this.props.innerRef || React.createRef(null);

this.setContextScrollPosition = this.setContextScrollPosition.bind(this);
}
Expand Down Expand Up @@ -58,7 +58,11 @@ class ScrollViewWithContext extends React.Component {
}
ScrollViewWithContext.propTypes = propTypes;

export default ScrollViewWithContext;
export default React.forwardRef((props, ref) => (
// eslint-disable-next-line react/jsx-props-no-spreading
<ScrollViewWithContext {...props} innerRef={ref} />
));

export {
ScrollContext,
};

0 comments on commit c4e8ea8

Please sign in to comment.