How to connect FullCalendar with Google Calendar API in React JSX

I’m building a calendar app for my organization and need help linking Google Calendar events to my FullCalendar component. I’ve been searching the docs but can’t find clear examples for React JSX integration.

"use client";

import { useState, useEffect } from 'react';
import CalendarView from '@fullcalendar/react';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
import interactionPlugin from '@fullcalendar/interaction';

const EventCalendar = () => {
  const [calendarEvents, setCalendarEvents] = useState([]);

  return (
    <div className="calendar-container p-4">
      <CalendarView
        plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin]}
        initialView="dayGridMonth"
        headerToolbar={{
          left: 'prev,next today',
          center: 'title',
          right: 'dayGridMonth,timeGridWeek'
        }}
        events={[
          { title: 'Team Meeting', date: '2025-02-05' },
          { title: 'Workshop', date: '2025-02-08' }
        ]}
      />
    </div>
  );
};

export default EventCalendar;

I’ve tried various approaches but nothing seems to work properly. Has anyone successfully connected Google Calendar data to FullCalendar in a React project?

Had the same problem last year building a client dashboard. Start with Google Calendar API authentication, then make a custom hook to fetch events. Enable the API in Google Cloud Console and grab your credentials. I used gapi for auth and a useEffect hook that pulls calendar data when the component loads. The annoying part is reformatting Google’s response to work with FullCalendar - you’ll map their summary, start.dateTime, and end.dateTime to title, start, and end. Then just pass those formatted events to your events prop instead of hardcoded data. Auth setup’s a pain at first, but Google’s Calendar API docs are solid once you push through the initial config.