React-transition-group: CSSTransitionGroup is not exported from 'react-transition-group'.

Created on 30 Jun 2020  路  10Comments  路  Source: reactjs/react-transition-group

I installed react-transition-group 1x baesd on the documentation
but i gut this error
Attempted import error: 'CSSTransitionGroup' is not exported from 'react-transition-group'.
here my code
import React, { useState } from 'react'
import './Toggle.css'
import { CSSTransitionGroup } from 'react-transition-group' // ES6
const TitleToggle = () => {
const [ isVisible, setVisisblity ] = useState(false)
return (


transitionName="example"
transitionEnterTimeout={500}
transitionLeaveTimeout={300}
>
{ isVisible &&

}


)
}
export default TitleToggle

Most helpful comment

Are there any updates so far?

All 10 comments

+1 for me, although I am using Typescript and installing types in this way did solve it:

npm install @types/[email protected]

I'm experiencing the same issue and got the same error message even with npm install @types/[email protected] .

Just for info type CSSTransitionGroup does not exist in last release it is named: TransitionGroup

From reading the docs CSSTransitionGroup and TransitionGroup are different.

Are there any updates so far?

Are there any updates so far?

I don't know if you're still having issue, but I found this and it seems to be working fine for me...
Here

I was having this issue too. I think the problem was that I had other dependencies that were installing the latest version of react-transition-group. So I installed v1 as an alias:
yarn add react-transition-group-v1@npm:[email protected]
And required it like this:
import { CSSTransitionGroup } from 'react-transition-group-v1'

For typescript i had issue as well and solve it by upgrading to new version
npm i @types/[email protected] seems to work for me

The documentation on the main page hasn't been updated (is this package being maintained anymore?).

I found this guide helpful instead: https://github.com/reactjs/react-transition-group/blob/70d1314d185e152b7754ab363e0ae088409858d5/Migration.md

You can use Framer-Motion more stable and better this days for animation..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alfrex92 picture Alfrex92  路  4Comments

bluefire2121 picture bluefire2121  路  3Comments

carly1987 picture carly1987  路  3Comments

nickmccurdy picture nickmccurdy  路  4Comments

Kylian030903 picture Kylian030903  路  3Comments