UNPKG

@quidone/react-native-wheel-picker

Version:

Picker is a UI component for selecting an item from a list of options.

19 lines 503 B
import { useEffect } from 'react'; const useSyncScrollEffect = ({ listRef, valueIndex, activeIndexRef, touching }) => { useEffect(() => { if (listRef.current == null || touching || activeIndexRef.current === valueIndex) { return; } listRef.current.scrollToIndex({ index: valueIndex, animated: true }); }, [valueIndex]); // eslint-disable-line react-hooks/exhaustive-deps }; export default useSyncScrollEffect; //# sourceMappingURL=useSyncScrollEffect.js.map