Updating state changes doesnt reflect
xnjethwa opened this issue · comments
After updating background color in resource array component is not re-rendering and background color is not
updating. is there any way to force update calendar or resourceLabelUpdate method or anything ?
I am updating color by resourceLabelDidMount
*** Resource component ****
function resourceGroupLabelContent(info) {
// console.log(info)
return (
<div key={info?.id} style={{backgroundColor:info?.eventBackgroundColor}}>
<MDBTooltip tag='div' placement="right" wrapperClass="tootlipWrapper" title={
<>
<div>{info?.resource?.title}</div>
<span>{info?.resource?.extendedProps?.technology}</span>
</>
}>
<span className="resourceName">{info?.resource?.title}</span>
</MDBTooltip>
</div>
)
}
React component
<FullCalendar
schedulerLicenseKey={FULL_CALENDAR_KEY}
ref={this.calendarRef}
plugins={[resourceTimeGridPlugin, resourceTimelinePlugin,scrollGridPlugin]}
initialView='resourceTimelineDay'
resources={this.state?.resources || []}
events={this.state?.events}
eventContent={Event}
resourceLabelContent={Resource}
height={'70vh'}
slotLabelFormat={{
hour: 'numeric',
minute: '2-digit',
omitZeroMinute: true,
meridiem: 'long'
}}
// contentHeight={'auto'}
// slotLabelInterval={30}
// width={'90vw'}
// scrollTime={'00:00'}
// stickyFooterScrollbar={true}
stickyHeaderDates={true}
dayMinWidth={150} // will cause horizontal scrollbars
// aspectRatio={1.7}
displayEventTime={false}
// datesAboveResources={true}
resourceLabelDidMount={(info) => { info.el.style.backgroundColor = info.resource.extendedProps?.bgColor }}
resourceAreaWidth={'15%'}
headerToolbar={false}
allDaySlot={false}
weekends={false}
/>
Please refer to the support page and use Stack Overflow for help. If this is a bug, please supply a runnable, stripped-down demonstration.