Ad

Import ReactCSSTransitionGroup In ES6 React Javascript

- 1 answer

I am using NPM to manage my packages and modules on my node.js app.

I have updated react to ^0.14.6 version and also installed ReactCSSTransitionGroups via npm.

Unfortunately uppon trying to use this addon in one of my child components I face the following error which says that its still undefined:

Uncaught ReferenceError: ReactCSSTransitionGroup is not defined

My implementation code:

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

Usage is within a maping function:

...
return(
   <ReactCSSTransitionGroup transitionName="example">
      {Content}
   </ReactCSSTransitionGroup>
);
...

Does anyone know how to fix this?

Ad

Answer

You're importing CSSTransitionGroup but using ReactCSSTransitionGroup. Switch one or the other so the variable lines up.

Ad
source: stackoverflow.com
Ad