react-native-calendars
react-native-calendars copied to clipboard
Can't change the flatlist backgroundColor of Agenda with calendarBackground in theme
Description
-
renderCalendarList
in agenda does not pass theme to CalendarList, becauseextractCalendarListProps
does not extract theme from props. Due to this problem, even though calendarBackground is set, the backgroundColor of CalendarList inside Agenda cannot be changed.
Expected Behavior
- extractCalendarListProps should extract theme from props.
I'm seeing this same behavior after upgrading to RN 0.68.2 (was previously on 0.61.5).
downgrade to 1.1286.0 fixed this
I'm using RN 0.64.3, and downgrading to version 1.1286.0 of react-native-calendars didn't fix the issue for me. The latest version of RNC also broke other theme attributes. With this setup, just the background colour isn't working.
Same issue here after updating to RN 0.68. Also the CalendarList theme isn't honored.
Looking at https://github.com/wix/react-native-calendars/blob/master/src/agenda/style.ts#L56 adding the below worked for me (the
<Agenda
theme={{
'stylesheet.agenda.main': {
reservations: {
backgroundColor: 'red',
},
}}
...
/>
<Agenda
showClosingKnob
renderItem={RenderItem}
items={{
'2022-11-28': [
{
name: 'Renan',
day: new Date().toISOString().split('T')[0],
height: 50,
},
],
}}
theme={{
reservationsBackgroundColor: '#fff',
}}
/>
reservationsBackgroundColor is not typed, use this.
need to fix, Theme interface doesn't export this key
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have posted a PR for this , PR here