Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sid68v opened this issue Nov 28, 2022 · 2 comments
Open

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

sid68v opened this issue Nov 28, 2022 · 2 comments

Comments

@sid68v
Copy link

sid68v commented Nov 28, 2022

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
Copy link

We have exactly the same issue.

Any help on this?

@lb2506
Copy link

lb2506 commented Jan 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants