反应警告:findDOMNode在StrictMode中已弃用

时间:2020-08-12 09:03:47

标签: reactjs warnings reactcsstransitiongroup

我正在尝试使用CSSTransition组,但收到警告“警告:StrictMode中已弃用findDOMNode。”。我一直在寻找Internet上的不同线程,但是它们都不有用,或者至少不确定如何实现它们。关于如何引用代码的任何想法?

<TransitionGroup>
 {tareasproyecto.map((tarea) => (
  <CSSTransition key={tarea.id} timeout={300} classNames="tarea">
    <Tarea tarea={tarea} />
  </CSSTransition>
))}
</TransitionGroup>

下面是我收到的错误

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here

谢谢!

0 个答案:

没有答案