My app is written in React. I have filters for my scheduler, and when changing them, the rows are filtered and made invisible (with onRowFilter in config).
When there are no rows visible, I want to display another component (noResults component).
The only solution I found was to use a workaround and create a variable:
const noRows = scheduler?.rows.all().filter(row => row.displayY !== undefined).length === 0
However even if the value changes from false to true correctly, it is not displaying my NoResult component and I always have an error:
"TypeError: Cannot read properties of null (reading 'clientWidth')"
Here is how it looks like:
{noRows ? (
<NoResults />
) : (
<DayPilotScheduler {...config} globalHolidays={holidays} ref={component => setScheduler(component && component.control)} />
)
Thank you in advance for the help!