Skip to content

Commit 8632675

Browse files
author
Chen Oppenhaim
committed
onContentSizeChange prop is not being ran
1 parent 7f41258 commit 8632675

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
@@ -23,7 +23,10 @@ export default class RNFadedScrollView extends Component {
2323
onContentSizeChange = (contentWidth, contentHeight) => {
2424
// Save the content height in state
2525
this.setState({ scrollHeight: contentHeight, scrollWidth: contentWidth });
26-
this.props.onContentSizeChange(contentWidth, contentHeight);
26+
27+
const { onContentSizeChange } = this.props;
28+
if (onContentSizeChange)
29+
onContentSizeChange(contentWidth, contentHeight);
2730
};
2831

2932
_onLayout(event) {

0 commit comments

Comments
 (0)