componentDidMount() {
this.onRefresh(this.props.subdomainConfig)
}
onRefresh = config => () => {
console.log('onRefresh', config)
}
In this react component the onRefresh function is not getting called at all when component mounts. If I use this function for RefreshControl then it is getting called.
<ScrollView
refreshControl={
<RefreshControl
refreshing={this.state.refreshing}
onRefresh={this.onRefresh(this.props.subdomainConfig)}
/>
}>
<ZoneListComponent
zones={zones}
onPressEdit={this.onPressEdit}
/>
</ScrollView>
Appreciate if someone can tell me why this is not getting called in componentDidMount but works for RefreshControl.