React/Reactstrap 警告:在严格模式树中检测到旧上下文 API [英] React / Reactstrap Warning: Legacy context API has been detected within a strict-mode tree

查看:70
本文介绍了React/Reactstrap 警告:在严格模式树中检测到旧上下文 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是全新的安装 - 我没有对警报组件进行任何转换

复制代码很简单

从react"导入React;从reactstrap"导入{警报};导出常量索引 = () =>{返回 (<div><Alert color='primary'>这是一个主要警报——检查一下!</Alert>

);};

错误消息:请更新以下组件:转换

如何更新Transition 或将其全部消除?

解决方案

如果有人在搜索问题后来到这里并寻求洞察力,就是这样.

React 带(在撰写本文时)使用 react-transition-group 东西淡入淡出,菜单上下滑动.在此处和 Github 上合并有关此主题的信息后,他们目前正在更新库.我已通过忽略警告完成了该组件的编码.

它并没有妨碍该组件的迭代.快乐编码.

This is brand new install - I have not put any transitions on the Alert component

To replicate the code it is simple

import React from "react";
import { Alert } from "reactstrap";

export const Index = () => {
   return (
      <div>
         <Alert color='primary'>This is a primary alert — check it out!</Alert>
      </div>
   );
};

Error Msg: Please update the following components: Transition

How does one go about updating Transition or eliminating it all together?

解决方案

In the event that someone comes here on after searching the question and is looking for insight this is it.

React strap (at the time of this post) uses the react-transition-group things fade in and out and menus slide up and down. After amalgamating the info on this subject here and on Github they are currently updating the library. I have finished the coding of that component by ignoring the warning.

It did not impede this iteration of that component. Happy Coding.

这篇关于React/Reactstrap 警告:在严格模式树中检测到旧上下文 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆