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

Warning: Failed prop type: Invalid prop `current` of type `object` supplied to `CalendarListItem`, expected `string`

Open musa-c opened this issue 4 years ago • 16 comments

Agenda warning! I am getting two kinds of errors. one is related to 'CanlendarList' and the other is related to 'CalendarListItem' but I couldn't figure out where the problem is. I would be glad if you help.

1. Warning:
Warning: Failed prop type: Invalid prop `current` of type `object` supplied to `CalendarListItem`, expected `string`
2. Warning:
Failed prop type: Invalid prop `current` of type `object` supplied to `CalendarList`, expected `string`.

import React, { useEffect, useState } from 'react' import { View, Text, TouchableOpacity } from 'react-native' import {Calendar, Agenda, LocaleConfig} from 'react-native-calendars'; import {Card} from "react-native-paper";

const Agenta = () => {

const [items, setItems] = useState({});
const loadItems = (day) => {
    setTimeout(() => {
      for (let i = -15; i < 85; i++) {
        const time = day.timestamp + i * 24 * 60 * 60 * 1000;
        const strTime = timeToString(time);
        if (!items[strTime]) {
          items[strTime] = [];
          const numItems = Math.floor(Math.random() * 3 + 1);
          for (let j = 0; j < numItems; j++) {
            items[strTime].push({
              name: 'Item for ' + strTime + ' #' + j,
              height: Math.max(50, Math.floor(Math.random() * 150)),
            });
          }
        }
      }
      const newItems = {};
      Object.keys(items).forEach((key) => {
        newItems[key] = items[key];
      });
      setItems(newItems);
    }, 1000);
  };

ss0

ss1

Environment

I'm using EXPO

musa-c avatar Dec 17 '21 19:12 musa-c

Same, I am having the same issue

softwarebyjims avatar Dec 19 '21 17:12 softwarebyjims

Also experiencing this issue after updating packages

flexa-david avatar Dec 21 '21 01:12 flexa-david

I am having the same issue. Can't use agenda in my project.

eedemir avatar Dec 25 '21 18:12 eedemir

Same here, I can use but has this error. Idk how to fixed.

jdaniel-ap avatar Dec 25 '21 21:12 jdaniel-ap

I'm experiencing same issue but I still can use the calendar despite this warning.

homosape avatar Dec 26 '21 14:12 homosape

i also experiencing the same issue it shows the same warning on the initial load.

Bhupendra1728 avatar Dec 29 '21 06:12 Bhupendra1728

Non expo have the same issue

PetromirDev avatar Dec 29 '21 19:12 PetromirDev

I have the same issue while using only Agenda. Agenda works as expected.

alperkilickaya avatar Dec 31 '21 09:12 alperkilickaya

Has anyone found a solution?

PetromirDev avatar Jan 03 '22 19:01 PetromirDev

same error :(

betomoedano avatar Jan 05 '22 00:01 betomoedano

Same

jasselmar avatar Jan 05 '22 23:01 jasselmar

Also getting this warning

ghost avatar Jan 06 '22 00:01 ghost

Updating the package to latest version solve the problem for me.

adSesugh avatar Jan 08 '22 10:01 adSesugh

Updating the package to latest version solve the problem for me.

Same here.

jdaniel-ap avatar Jan 08 '22 16:01 jdaniel-ap

Paketi en son sürüme güncellemek benim için sorunu çözüyor.

problem solved thanks

musa-c avatar Jan 08 '22 23:01 musa-c

facing same issue and calendar is not loading even.

fazalabbas-dev avatar Jun 20 '22 17:06 fazalabbas-dev