我试图实现完整的日历与事件来源从谷歌日历。日历正在呈现,我的API键和日历ID是从我的.env中正确记录的控制台,但是我得到了一个错误
CalendarDataManager.ts:667 Unknown option 'googleCalendarApiKey'
听起来好像它不认识我的API密钥的道具,但根据文档和其他教程,这看起来是正确的。有什么想法吗?
import "./eventcalendar.css";
// full calendar node package
import FullCalendar from "@fullcalendar/react"; // must go before plugins
import dayGridPlugin from "@fullcalendar/daygrid"; // a plugin!
import interactionPlugin from "@fullcalendar/interaction"; // allows click events
import googleCalendarPlugin from "@fullcalendar/google-calendar";
function EventCalendar() {
const googleCalendarURL = process.env.REACT_APP_GOOGLE_API_KEY;
// const myGoogleCalendarID = process.env.REACT_APP_GOOGLE_ID;
const myGoogleCalendarID = "samplestring@gmail.com";
// When a date grid is clicked, this function will invoke
const handleDateClick = (dateClickInfo) => {
console.log(dateClickInfo.dateStr);
};
return (
<div className="calendar-container ">
<FullCalendar
plugins={[dayGridPlugin, interactionPlugin, googleCalendarPlugin]}
initialView="dayGridMonth"
dateClick={handleDateClick}
googleCalendarApiKey={googleCalendarURL}
events={[{ googleCalendarId: myGoogleCalendarID }]}
/>
</div>
);
}
export default EventCalendar;发布于 2022-07-12 22:07:12
我在其他地方找不到这个错误,下面是对我有用的内容:
再次检查您的package.json,以确保您正在使用的@完整日历包都在那里。我的应用程序被安装在两个不同的区域,这导致了错误。
https://stackoverflow.com/questions/72958654
复制相似问题