Usage of legacy context API
Author: thetricCreated Dec 28, 2018Updated Feb 17, 2026
- components:
TabPane,Dropdown(,Item,Menu,Toggle),Manager,PopperTargetHelper,CarousellItem(see https://github.com/reactstrap/reactstrap/search?q=contextTypes&unscoped_q=contextTypes) - reactstrap version
6.5.0 - import method:
es - react version
16.7.0 - bootstrap version
4.2.1
What is happening?
When using <React.StrictMode> Reacts advises against using the legacy context API:
Warning: Legacy context API has been detected within a strict-mode tree:
in StrictMode (at App.tsx:27)
in App (at src/index.tsx:7)
Please update the following components: Dropdown, DropdownItem, DropdownMenu, DropdownToggle, Manager
Learn more about this warning here:
https://fb.me/react-strict-mode-warningsFrom https://reactjs.org/docs/context.html#legacy-api:
React previously shipped with an experimental context API. The old API will be supported in all 16.x releases, but applications using it should migrate to the new version. The legacy API will be removed in a future major React version. [...]
What should be happening?
Reactstrap should be using the new Context API.
Steps to reproduce issue
Wrap an example app using some of the components mentions at the beginning in React.StrictMode and start it in development mode.
Code
https://stackblitz.com/edit/reactstrap-saxswj?file=Example.js
Source: reactstrap/reactstrap