Hello!
https://stackblitz.com/edit/react-kr5cmxga?file=app%2FcustomItem.tsx,app%2Fapp.tsx,resources.ts
I am facing a performance issue with the Scheduler component. I pass a
CustomItem into the Scheduler, and inside this CustomItem, I use the standard SchedulerItem from the library. The Scheduler also includes a context menu Popup that opens on a right-click.When the context menu opens, it updates a
useState value inside the Scheduler component. This causes the Scheduler to re-render, which in turn forces all of its child components—including all CustomItem instances—to re-render as well.To prevent these unnecessary re-renders, I wrapped
CustomItem in React.memo (line 32 in the provided example). However, this did not solve the problem. All CustomItem components still re-render, which negatively impacts the application's performance.I have simplified this example for clarity. In my actual project, I pass more than just onContextMenuOpen into CustomItem, so my question goes beyond just fixing the popup behavior. Is there a way to prevent all CustomItem instances from re-rendering when the parent component updates, given that I use custom items and pass additional props into them?
Thanks!
