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.

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

See original GitHub issue

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

  • npm ls react-native-calendars: react-native-calendars@1.1274.0
  • npm ls react-native: react-native@0.63.2

I’m using EXPO

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16

github_iconTop GitHub Comments

3reactions
adSesughcommented, Jan 8, 2022

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

0reactions
fazalabbasjoyiacommented, Jun 20, 2022

facing same issue and calendar is not loading even.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid prop `navigation` of type `object` supplied to ...
Try to check your propTypes, there's probably something like: someComponentName.propTypes = { navigation:PropTypes.number }.
Read more >
Invalid Prop 'Items[0]' Of Type 'String' Supplied To ... - ADocLib
[Vue warn]:Invalid prop: type check failed for prop data. Expected Object got Array The error is: expect an object get an array The...
Read more >
Invalid prop `selected` of type `String` supplied to `Calendar ...
Coding example for the question Invalid prop `selected` of type `String` supplied to `Calendar`, expected instance of `Date`?-Reactjs.
Read more >
react-native-calendars - npm
Parameters that require date types accept YYYY-MM-DD formatted date-strings , JavaScript date objects, calendar objects and UTC timestamps .
Read more >
React Native Calendar Components 🗓️ - BestofReactjs
import { Calendar, CalendarList, Agenda } from 'react-native-calendars'; ... date types accept YYYY-MM-DD formated date-strings , JavaScript date objects, ...
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