question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't change the flatlist backgroundColor of Agenda with calendarBackground in theme

See original GitHub issue

Description

  • renderCalendarList in agenda does not pass theme to CalendarList, because extractCalendarListProps 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.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

1reaction
wallacerenancommented, Nov 28, 2022
<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

0reactions
dpdentoncommented, Oct 21, 2022

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',
        },
      }}
     ...
 />
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Calendars : How to change the background ...
React Native Calendars : How to change the background color of only one item using Redux ; React, {useState, useCallback, useEffect} from 'react' ......
Read more >
FlatList - React Native
A performant interface for rendering basic, flat lists, supporting the most handy features:
Read more >
React Native ,Flatlist ,how to change the background color ...
Coding example for the question React Native ,Flatlist ,how to change the background color when click one of the card?-React Native.
Read more >
https://gisweb10.highpointnc.gov/js/libs/fullcalen...
Significant changes to HTML/CSS skeleton: - Leverages tables for liquid ... will be applied to the entire event source: - color (changes both...
Read more >
How To Use React Native Flatlist [Guide] - Flatlogic Blog
FlatList doesn't require a lot of code. It needs only two props to start and you don't have to make a fancy style...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found