Warning: Failed prop type: Invalid prop `current` of type `object` supplied to `CalendarListItem`, expected `string`
See original GitHub issueAgenda 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);
};
Environment
npm ls react-native-calendars
: react-native-calendars@1.1274.0npm ls react-native
: react-native@0.63.2
I’m using EXPO
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Updating the package to latest version solve the problem for me.
facing same issue and calendar is not loading even.