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. (Collapse) #1975

Closed
keslavi opened this issue Oct 8, 2020 · 1 comment
Closed

Comments

@keslavi
Copy link

keslavi commented Oct 8, 2020

  • components: Collapse, Transition

  • reactstrap version: `8.6.1'

  • import method es

  • react version ^16.11.0

  • bootstrap version ^4.3.1

What is happening?

things are working but the following console warning is appearing stating that the old contextApi is being used.

What should be happening?

the console should not be generating a warning message; my team is trained to keep the console clean in order to troubleshoot 'real' errors

Steps to reproduce issue

  1. create a standard react app
  2. create a generic reactstrap menu with collapse
  3. observe console warning message

Error message in console

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: Transition

Learn more about this warning here: https://fb.me/react-legacy-context
in Transition (created by Collapse)
in Collapse (at header.jsx:30)
in nav (created by Navbar)
in Navbar (at header.jsx:25)
in div (at header.jsx:24)
in Header (at App.js:30)
in Router (at App.js:29)
in div (created by Container)
in Container (at App.js:28)
in div (at App.js:27)
in App (at src/index.js:18)
in Provider (at src/index.js:16)
in StrictMode (at src/index.js:15)

Code

//works but different warning messages
https://stackblitz.com/edit/reactstrap-qtju12?file=Example.js

on my machine (yeah i hate those words as well) it displays the console message when I add Collapse in.

@kyletsang
Copy link
Member

Dupe of #1962

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

2 participants