【问题标题】:Warning: Legacy context API has been detected within a strict-mode tree警告:在严格模式树中检测到旧版上下文 API
【发布时间】:2021-07-07 05:07:58
【问题描述】:

所有 16.x 版本都将支持旧 API,但使用它的应用程序应迁移到新版本。 请更新以下组件:Transition。

当我尝试使用 react.严格模式,但警告仍然出现在 console.log chrome 浏览器上我在 react 中使用 reactstrab 组件(如 Card、Modal)

【问题讨论】:

  • 你使用的是哪个版本的 reactstrap?

标签: reactjs reactstrap


【解决方案1】:

转到 index.js 删除 React.StrictMode 标记,如以下代码

ReactDOM.render(
    <App />
document.getElementById('root')
);

【讨论】:

    猜你喜欢
    • 2020-08-22
    • 2020-10-27
    • 2021-03-09
    • 2020-06-13
    • 1970-01-01
    • 1970-01-01
    • 2017-02-01
    • 1970-01-01
    • 2017-11-10
    相关资源
    最近更新 更多