Attempted import error: 'react-transition-group' does not contain a default export (imported as 'ReactCSSTransitionGroup')

Viewed 1543

I can't figure out how to set up ReactCSSTransitionGroup. Here are the steps I've attempted:

  1. npm install react-transition-group
  2. import ReactCSSTransitionGroup from 'react-transition-group'; (added to the top of my JS file.)

And I get, "Attempted import error: 'react-transition-group' does not contain a default export (imported as 'ReactCSSTransitionGroup')."

The official documentation (https://reactjs.org/docs/animation.html#low-level-api-reacttransitiongroup) doesn't specify how to fully set this up so I'm a bit lost here.

enter image description here

Here are the details in the documentation that I'm attempting to follow.

enter image description here enter image description here

1 Answers

just change the import satement to

import { CSSTransition } from 'react-transition-group';

or

import { CSSTransitionGroup } from 'react-transition-group'

Related