search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

onBeforeCellRender loading after trigger click

Asked by Boris Civcic
2 years ago.

Hello,
We found issue with Daypilot. Because of this issue, we have problems with performances(modal loading issue).
On first load we got: `onBeforeCellRender`, and that's okay. But after that we trigger click function, and if we have any state inside `onBeforeCellRender` he will be recalled again.
This causing a lot of problem to us, because modal was opening very slow in that case. A lot of rendering from onBeforeCellRender , which is not necessary I believe.

Notice:
If we don't have any state inside `onCellClicked` function, everything will be fine. `onBeforeCellRender` will not be called.
Please take a look a video.

Answer posted by Dan Letecky [DayPilot]
2 years ago.

At this moment, the React Scheduler will always update on state changes.

This is a design decision and the alternative would be to perform a deep comparison of the current/previous props. The props can be very deep and this would introduce a potential performance issue of a different type.

I recommend not using the state in onEventClick (if possible) or to wrap this state in a standalone component - this approach is used in the following tutorial:
https://code.daypilot.org/76269/react-scheduler-how-to-search-events

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.