Skip to content

Commit 2e1e0db

Browse files
authored
Merge pull request #4 from chenop/onContentSizeChange_prop_is_not_being_ran
On content size change prop is not being ran
2 parents f438f17 + 8632675 commit 2e1e0db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class RNFadedScrollView extends Component {
88
constructor(props) {
99
super(props);
1010
this.state = {
11-
// We don't know the size of the content initially, and the probably won't instantly try to scroll,
11+
// We don't know the size of the content initially, and the probably won't instantly try to scroll,
1212
// so set the initial content height and width to 0
1313
scrollHeight: 0,
1414
scrollWidth: 0,
@@ -23,6 +23,10 @@ class RNFadedScrollView extends Component {
2323
onContentSizeChange = (contentWidth, contentHeight) => {
2424
// Save the content height in state
2525
this.setState({ scrollHeight: contentHeight, scrollWidth: contentWidth });
26+
27+
const { onContentSizeChange } = this.props;
28+
if (onContentSizeChange)
29+
onContentSizeChange(contentWidth, contentHeight);
2630
};
2731

2832
_onLayout(event) {

0 commit comments

Comments
 (0)