From 54cd381d318b357e6dc042b7325a131b7a206a0e Mon Sep 17 00:00:00 2001 From: "Jeferson S. Brito" Date: Sun, 5 May 2024 16:02:25 -0300 Subject: [PATCH] fix: NewCalendarList calendarProps not passed in --- src/calendar-list/new.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calendar-list/new.tsx b/src/calendar-list/new.tsx index 52b6615796..5874843004 100644 --- a/src/calendar-list/new.tsx +++ b/src/calendar-list/new.tsx @@ -41,14 +41,14 @@ const CalendarList = (props: CalendarListProps) => { } = props; const style = useRef(styleConstructor(calendarProps?.theme)); const list = useRef(); - const [items, setItems] = useState(getDatesArray(initialDate, scrollRange)); + const [items, setItems] = useState(() => getDatesArray(initialDate, scrollRange)); const [positionIndex, setPositionIndex] = useState(scrollRange); /** Static Header */ const [currentMonth, setCurrentMonth] = useState(initialDate || items[scrollRange]); const shouldRenderStaticHeader = staticHeader && horizontal; - const headerProps = extractHeaderProps(props); + const headerProps = extractHeaderProps(props?.calendarProps ?? {}); const staticHeaderStyle = useMemo(() => { return [style.current.staticHeader, calendarProps?.headerStyle]; }, [calendarProps?.headerStyle]); @@ -176,7 +176,7 @@ const CalendarList = (props: CalendarListProps) => { }; }, [scrollViewProps]); - const renderItem = useCallback((_type: any, item: string) => { + const renderItem = useCallback((_type: string | number, item: string) => { return ( { hideExtraDays={calendarProps?.hideExtraDays || true} style={[style.current.calendar, calendarProps?.style]} headerStyle={horizontal ? calendarProps?.headerStyle : undefined} - testID={`${testID}_${item}`} + testID={testID ? `${testID}_${item}` : undefined} // context={context} /> );