Skip to content

Commit dbc3be7

Browse files
authored
feat(infiniteAgendaList): support passing scrollViewProps (#2497)
* feat(infiniteAgendaList): support passing scrollViewProps * Fix PR comments * Omit viewOffset from InfiniteAgendaList props
1 parent da9b1bd commit dbc3be7

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

src/expandableCalendar/infiniteAgendaList.tsx

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,24 @@ import {AgendaSectionHeader, AgendaListProps} from "./AgendaListsCommon";
3030
* @extends: InfiniteList
3131
* @example: https://github.com/wix/react-native-calendars/blob/master/example/src/screens/expandableCalendar.js
3232
*/
33-
const InfiniteAgendaList = (props: AgendaListProps) => {
34-
const {
35-
theme,
36-
sections,
37-
scrollToNextEvent,
38-
avoidDateUpdates,
39-
onScroll,
40-
renderSectionHeader,
41-
sectionStyle,
42-
dayFormatter,
43-
dayFormat = 'dddd, MMM d',
44-
useMoment,
45-
markToday = true,
46-
infiniteListProps,
47-
renderItem,
48-
onEndReached,
49-
onEndReachedThreshold,
50-
refreshControl
51-
} = props;
52-
33+
const InfiniteAgendaList = ({
34+
theme,
35+
sections,
36+
scrollToNextEvent,
37+
avoidDateUpdates,
38+
onScroll,
39+
renderSectionHeader,
40+
sectionStyle,
41+
dayFormatter,
42+
dayFormat = 'dddd, MMM d',
43+
useMoment,
44+
markToday = true,
45+
infiniteListProps,
46+
renderItem,
47+
onEndReached,
48+
onEndReachedThreshold,
49+
...others
50+
}: Omit<AgendaListProps, 'viewOffset'>) => {
5351
const {date, updateSource, setDate} = useContext(Context);
5452

5553
const style = useRef(styleConstructor(theme));
@@ -244,7 +242,7 @@ const InfiniteAgendaList = (props: AgendaListProps) => {
244242
layoutProvider={layoutProvider}
245243
onScroll={_onScroll}
246244
onVisibleIndicesChanged={_onVisibleIndicesChanged}
247-
scrollViewProps={{onMomentumScrollEnd: _onMomentumScrollEnd, nestedScrollEnabled: true, refreshControl}}
245+
scrollViewProps={{nestedScrollEnabled: true, ...others, onMomentumScrollEnd: _onMomentumScrollEnd}}
248246
onEndReached={_onEndReached}
249247
onEndReachedThreshold={onEndReachedThreshold as number | undefined}
250248
disableScrollOnDataChange

0 commit comments

Comments
 (0)