0

I was working on a react-native project using expo cli, in which i need to display a calendar. I was using the dayComponent property of the calendar to apply stylings to specific days as per the requirement and it was working fine. However I recently moved to react-native cli due to compatibility issues with another library. Since then the dayComponent property is not executing at all. In the below code, even the console.log is not executed.

import React from 'react';
import { Calendar } from 'react-native-calendars';
const App = () =>  {
  return (
    <Calendar 
    dayComponent={(e)=>{
      console.log(e);
      return <View><Text>{e.date.day}</Text></View>;
    }}
    />
  )
};

export default App;

One thing that i can think of, is that I have installed the latest jdk version. Which required me to do the following

  1. add org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED to gradle.properties
  2. add jcenter() under allProjects repositories in build.gradle

Could the jdk version be the problem? or anything else?

Ramki
  • 389
  • 1
  • 9

1 Answers1

0

it's the issue with the latest version of react-native-calendars, they have merged the PR to fix it about 1 hour before my answer. You can wait for new release or edit the version in package.json

from

"react-native-calendars": "^1.1274.0",

to

"react-native-calendars": "1.1274.0",

I assumed that you are using version 1.1274.0 like me