-
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
I have the following code.
'use client'
import { SyntheticEvent } from 'react'
import ApiCalendar from 'react-google-calendar-api'
export const useGoogleCalendar = () => {
const calendar = new ApiCalendar({
clientId: process.env.NEXT_PUBLIC_CLIENT_ID as string,
apiKey: process.env.NEXT_PUBLIC_API_KEY as string,
scope: "https://www.googleapis.com/auth/calendar",
discoveryDocs: [
"https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest",
],
})
const handleItemClick = (event: SyntheticEvent<any>, name: string) => {
console.info('Funcao handleItemClick', event, name)
if (name === 'sign-in') {
calendar.handleAuthClick();
} else if (name === 'sign-out') {
calendar.handleSignoutClick();
}
};
return {
api: calendar,
handleItemClick,
}
}When I click on the button that launches one of these events, the api.sign variable never changes value. Is this correct?
Metadata
Metadata
Assignees
Labels
No labels