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

Content flickers when calendar component is reinitialized via useState #7234

Closed
1 task done
Azaryan-A opened this issue Mar 6, 2023 · 7 comments
Closed
1 task done

Comments

@Azaryan-A
Copy link

Reduced Test Case

https://stackblitz.com/edit/github-urj6el-oghacn?file=src%2FDemoApp.jsx

Do you understand that if a reduced test case is not provided, we will intentionally delay triaging of your ticket?

  • I understand

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

React

Bug Description

It's like custom view content unmounts and mounts again when fullcalendar props change, it causes content flickering when I want to update events or the header toolbar.

@acerix acerix changed the title custom view content flickers when calendar props changed Content flickers when calendar component is reinitialized via useState Mar 8, 2023
@acerix
Copy link
Member

acerix commented Mar 8, 2023

I believe it's not intended to initialize the calendar after useState in this way since that causes the calendar component to reinitialize when the state is changed, which would hurt performance. You can instead update events using the API, for example providing them "as a function", to avoid that:

https://fullcalendar.io/docs/events-function

Related issue here:
#7230

@Azaryan-A
Copy link
Author

Custom view content 'flickers' even if updating some props via API. for example "customButtons". This problem occurred after updating the version of fullcalendar from v5 to v6. Please check this example - https://stackblitz.com/edit/github-urj6el-oghacn?file=src%2FDemoApp.jsx

@nandorojo
Copy link

nandorojo commented Apr 3, 2023

I have a similar issue. Whenever I use eventContent's content injection with JSX, the calendar has very noticeable flickers.

I can provide a reproduction tomorrow if it's useful. I'm also willing to sponsor a solution @acerix for what that's worth!

@austintackaberry
Copy link

I am experiencing the same issue as @nandorojo. Whenever I use eventContent's content injection with JSX and I issue a refetchEvents call, all of the events flicker. If I remove eventContent, the flicker goes away. On version 6.1.4

@nandorojo
Copy link

nandorojo commented Apr 9, 2023

I wonder if there is any potential fix. Or if I could get pointed to the code in charge of this that I could play with and try to patch.

@nandorojo
Copy link

It's especially noticeable if the max dates isn't true and the order of events changes. Here's a video: https://www.loom.com/share/5626f7eac906400ba46819db73e1590a

@arshaw
Copy link
Member

arshaw commented May 8, 2023

This should be fixed in v6.1.7

Please see my comment on a related issue:
#7165 (comment)

Please post here on this ticket if you're still experiencing problems after upgrading.

@arshaw arshaw closed this as completed May 8, 2023
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

5 participants