Skip to content

Instantly share code, notes, and snippets.

View gandarain's full-sized avatar
💤
sleep

Ganda Rain Panjaitan gandarain

💤
sleep
View GitHub Profile
@jbutko
jbutko / detect-scroll.js
Created September 10, 2018 06:28
React Native: Detect ScrollView has reached the end
import React from 'react';
import {ScrollView, Text} from 'react-native';
const isCloseToBottom = ({layoutMeasurement, contentOffset, contentSize}) => {
const paddingToBottom = 20;
return layoutMeasurement.height + contentOffset.y >=
contentSize.height - paddingToBottom;
};
const MyCoolScrollViewComponent = ({enableSomeButton}) => (