namespace-ee / react-calendar-timeline

A modern and responsive react timeline component.
MIT License
1.91k stars 613 forks source link

Legacy context API has been detected within a strict-mode tree. #887

Open sid68v opened 1 year ago

sid68v commented 1 year ago

components: TimelineHeaders, SidebarHeader, DateHeader,

"react": "^18.0.2", "react-calendar-timeline": "^0.28.0",

What is happening? Warning: Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: Item,ReactCalendarTimeline

What should be happening? I used the library to create a simple timeline with dummy data and I have the message described above in strict mode. Warning shouldn't be there.

Steps to reproduce issue Just create a page in React and create a simple chart.

Image from console image

Sample code :

 <Timeline
        groups={groups}
        items={items}
        keys={keys}
        fullUpdate
        itemTouchSendsClick={false}
        stackItems={true}
        itemHeightRatio={0.75}
        showCursorLine
        canMove={true}
        canResize="both"
        defaultTimeStart={defaultTimeStart}
        defaultTimeEnd={defaultTimeEnd}
        onItemClick={handleItemClick}
        onItemMove={handleItemMove}
        onItemResize={handleItemResize}
        itemRenderer={itemRenderer}
      >
        <TimelineHeaders className="sticky">
          <SidebarHeader>
            {({ getRootProps }) => {
              return (
                <div
                  className="react-header-name"
                  style="fontsize: 20px;"
                  {...getRootProps()}
                >
                  Work Stations
                </div>
              );
            }}
          </SidebarHeader>
          <DateHeader unit="primaryHeader" />
          <DateHeader />
        </TimelineHeaders>
      </Timeline>

image

MiguelVis commented 1 year ago

We have exactly the same issue.

Any help on this?

lb2506 commented 1 year ago

Same to me, if anyone solved it It works but i have the red warning