fix: load component on client

This commit is contained in:
vidvidvid
2021-11-21 10:13:55 +01:00
committed by Alec LaLonde
parent 4f7d0ef770
commit f79f6d0a90

View File

@@ -1,8 +1,16 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
const calId = 'nih59ktgafmm64ed4qk6ue8vv4@group.calendar.google.com';
export const Calendar: React.FC = () => {
const [isComponentMounted, setIsComponentMounted] = useState(false);
useEffect(() => setIsComponentMounted(true), []);
if (!isComponentMounted) {
return null;
}
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
return (