ReactCSSTransitionGroup with React 0.14 and a rather invariant violation: addComponentAsRefTo (...)

Ok, I used some work in ReactJS with ES3 syntax. Now I try my best with ES6, but I can’t just use ReactCSSTransitionGroup because of an absolutely crazy bug that says

Invariant violation: addComponentAsRefTo (...): only ReactOwner can have links. This usually means that you are trying to add ref to a component that does not have an owner (ie. Not created inside the render method of another component). Try visualizing this component inside the new top-level component that will contain the link.

What is it?

    import React from 'react';
    import ReactCSSTransitionGroup from 'react-addons-css-transition-group';

    render(){
     return <ReactCSSTransitionGroup transitionName={transitions}>
      <Content/>
    </ReactTransition> 
    }
+4
source share
1

, external webpack, react react-dom, , react-addons-css-transition-group, , react , .

Webpack react, react-dom react-addons-css-transition-group .

+4

Source: https://habr.com/ru/post/1617857/


All Articles