@@ -7,7 +7,6 @@ import isUndefined from 'lodash/isUndefined';
77import debounce from 'lodash/debounce' ;
88import isEqual from 'lodash/isEqual' ;
99
10-
1110import XDate from 'xdate' ;
1211
1312import React , { useCallback , useContext , useEffect , useMemo , useRef } from 'react' ;
@@ -26,17 +25,16 @@ import {
2625} from 'react-native' ;
2726
2827import { useDidUpdate } from '../hooks' ;
29- import { isToday , isGTE , sameDate } from '../dateutils' ;
3028import { getMoment } from '../momentResolver' ;
29+ import { isToday , isGTE , sameDate } from '../dateutils' ;
3130import { parseDate } from '../interface' ;
3231import { getDefaultLocale } from '../services' ;
33- import { UpdateSources , todayString } from './commons' ;
3432import { Theme } from '../types' ;
35- import styleConstructor from './style ' ;
33+ import { UpdateSources , todayString } from './commons ' ;
3634import constants from '../commons/constants' ;
35+ import styleConstructor from './style' ;
3736import Context from './Context' ;
3837
39-
4038const viewabilityConfig = {
4139 itemVisiblePercentThreshold : 20 // 50 means if 50% of the item is visible
4240} ;
@@ -183,7 +181,7 @@ const AgendaList = (props: AgendaListProps) => {
183181 viewOffset : ( constants . isAndroid ? sectionHeight . current : 0 ) + viewOffset
184182 } ) ;
185183 }
186- } , 1000 , { leading : false , trailing : true } ) , [ ] ) ;
184+ } , 1000 , { leading : false , trailing : true } ) , [ viewOffset , sections ] ) ;
187185
188186 const _onViewableItemsChanged = useCallback ( ( info : { viewableItems : Array < ViewToken > ; changed : Array < ViewToken > } ) => {
189187 if ( info ?. viewableItems && ! sectionScroll . current ) {
@@ -250,6 +248,7 @@ const AgendaList = (props: AgendaListProps) => {
250248
251249 return (
252250 < SectionList
251+ stickySectionHeadersEnabled
253252 { ...props }
254253 ref = { list }
255254 keyExtractor = { _keyExtractor }
@@ -299,8 +298,3 @@ AgendaList.propTypes = {
299298 sectionStyle : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . number , PropTypes . array ] ) ,
300299 avoidDateUpdates : PropTypes . bool
301300} ;
302- AgendaList . defaultProps = {
303- dayFormat : 'dddd, MMM d' ,
304- stickySectionHeadersEnabled : true ,
305- markToday : true
306- } ;
0 commit comments