Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullcalendar style not working on React Remix 1.14.0 #7261

Closed
iChwn opened this issue Mar 27, 2023 · 8 comments
Closed

Fullcalendar style not working on React Remix 1.14.0 #7261

iChwn opened this issue Mar 27, 2023 · 8 comments

Comments

@iChwn
Copy link

iChwn commented Mar 27, 2023

Which connector are you using (React/Angular/etc)?

React

Bug Description

I have an issue when trying to use Fullcalendar on my Remix project, the styles are not loaded in remix js, any suggestion to fix this issue?
image

Here is my simple implementation with the plugin

<FullCalendar
  plugins={[ dayGridPlugin ]}
  initialView="dayGridMonth"
  events={[
    { title: 'event 1', date: '2023-03-01' },
    { title: 'event 2', date: '2023-03-02' }
  ]}
  viewClassNames="h-full"
/>
@arshaw arshaw added this to the next-release milestone Apr 3, 2023
@imshubhamsingh
Copy link

imshubhamsingh commented Apr 6, 2023

@iChwn I recently faced the same issue. I solved it by adding fullcalendar CSS via CDN on the page where I'm using the calendar.

export const links: LinksFunction = () => {
  return [
    {
      rel: "stylesheet",
      href: "https://cdn.jsdelivr.net/npm/fullcalendar@5.11.3/main.min.css",
    },
  ];
};

Currently side-effect import import in Remix is not that great. This is being worked upon. Details: https://remix.run/docs/en/1.15.0/guides/styling#css-side-effect-imports

I would also suggest to wrap the Calendar component in a ClientOnly component so that it is only rendered after hydration, otherwise you will see the flicker of calendar from non-styled one that you shared to styled one.

@arshaw arshaw modified the milestones: next-release, v6.1.6 Apr 23, 2023
@arshaw
Copy link
Member

arshaw commented Apr 23, 2023

Sorry, I commented on the wrong issue

@iChwn
Copy link
Author

iChwn commented Apr 28, 2023

@iChwn I recently faced the same issue. I solved it by adding fullcalendar CSS via CDN on the page where I'm using the calendar.

export const links: LinksFunction = () => {
  return [
    {
      rel: "stylesheet",
      href: "https://cdn.jsdelivr.net/npm/fullcalendar@5.11.3/main.min.css",
    },
  ];
};

Currently side-effect import import in Remix is not that great. This is being worked upon. Details: https://remix.run/docs/en/1.15.0/guides/styling#css-side-effect-imports

I would also suggest to wrap the Calendar component in a ClientOnly component so that it is only rendered after hydration, otherwise you will see the flicker of calendar from non-styled one that you shared to styled one.

This actually works for me, thank you for the suggestion

@iChwn iChwn closed this as completed Apr 28, 2023
@arshaw
Copy link
Member

arshaw commented May 8, 2023

I'll reopen this issue for coming up with a proper fix.

@arshaw arshaw reopened this May 8, 2023
@arshaw arshaw modified the milestones: next-release, v6.1.8 May 25, 2023
@arshaw
Copy link
Member

arshaw commented May 26, 2023

I've created an official workaround for this:

@arshaw arshaw closed this as completed May 26, 2023
@iChwn
Copy link
Author

iChwn commented Jun 9, 2023

I've created an official workaround for this:

Thank You!

@RoniqueRicketts
Copy link

The recommendation on FullCalendar is to add <style data-fullcalendar /> in the tag in your root.tsx file. The information is found on https://fullcalendar.io/docs/react

Ps. I am adding this here for future users.

@jordisantamaria
Copy link

Hi, the fix of <style data-fullcalendar /> works on localhost, but is not working for us in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants