react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

Expandable calendar invisible

Open OscarBlackbullion opened this issue 4 months ago • 6 comments

Hi. I'm having an issue with the ExpandableCalendar component. I am using the latest version (1.1313.0).

For some reason, on initial render of my screen the calendar is invisible. On inspect, I can see that the entire ExpandableCalendar component's opacity is set to 0. If I navigate away from the screen and then back, the calendar appears, so it seems to be an issue on the initial render/layout of the screen.

Here is a reproducible example:

import { format } from 'date-fns/esm';
import { Text, View } from 'react-native';
import { CalendarProvider, ExpandableCalendar } from 'react-native-calendars';
import { DayProps } from 'react-native-calendars/src/calendar/day';
import { FlatList } from 'react-native-gesture-handler';

const DummyScreen = () => {
  const date = format(new Date(), 'yyyy-MM-dd');
  return (
    <CalendarProvider date={date}>
      <ExpandableCalendar
        style={{ opacity: 1 }}
        contentContainerStyle={{ opacity: 1 }}
        dayComponent={renderDayComponent}
        firstDay={1}
      />
      <FlatList
        renderItem={(i) => (
          <View>
            <Text style={{ color: '#ffffff' }}>{i.item}</Text>
          </View>
        )}
        data={[1, 2, 3]}
      />
    </CalendarProvider>
  );
};

function renderDayComponent({ children }: DayProps) {
  return <Text style={{ color: '#ffffff' }}>{children}</Text>;
}

export default DummyScreen;

I have also included some screenshots to demonstrate the issue: Image

Image

Any ideas why this might be happening?

OscarBlackbullion avatar Aug 28 '25 09:08 OscarBlackbullion

Hey @OscarBlackbullion - check this guy out: https://github.com/wix/react-native-calendars/pull/2653 we were facing the same issue and had to patch it.

NiharR27 avatar Aug 28 '25 23:08 NiharR27

Thank you @NiharR27, this resolved the issue!

OscarBlackbullion avatar Sep 01 '25 10:09 OscarBlackbullion

Image

Having the same issue. The dates are not rendering... Could be related? I tried @NiharR27 fix and its not working for me.

luisscruza avatar Sep 13 '25 11:09 luisscruza

@luisscruza did you manage to fix this issue? If so, how?

AndreMaz avatar Oct 02 '25 10:10 AndreMaz

@luisscruza did you manage to fix this issue? If so, how?

Hey! I think the problem was not related to the library itself but other peer dependencies. I had this problem while upgrading Expo SDK from 53 > 54. Apparently, there was an issue with some dependencies with their new auto linking Autolinking SDK4 so I opted out by adding the expo.autolinking.legacy_shallowReactNativeLinking: true in my package.json. This fixed my issues.

My guess is that something is broken in the Flatlist that breaks this component. Didn't dig further.

luisscruza avatar Oct 02 '25 20:10 luisscruza

use v1.1307.0

Parth4149 avatar Nov 01 '25 15:11 Parth4149