I have a Text with long text inside a ScrollView and I want to detect when the user has scrolled to the end of the text so I can enable a button.>
As people helped here I will add the simple code they write to make reached to top and reached to bottom event and I did a little illustration to make things simpler
{
if(isCloseToTop(nativeEvent)){
//do something
}
if(isCloseToBottom(nativeEvent)){
//do something
}
}}
>
...contents
isCloseToBottom({layoutMeasurement, contentOffset, contentSize}){
return layoutMeasurement.height + contentOffset.y >= contentSize.height - 20;
}
ifCloseToTop({layoutMeasurement, contentOffset, contentSize}){
return contentOffset.y == 0;
}