react-transition-group icon indicating copy to clipboard operation
react-transition-group copied to clipboard

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

Open ariannargesi opened this issue 5 years ago • 11 comments

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 (

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

Toggle me!

} </CSSTransitionGroup> <button onClick={()=>setVisisblity(!isVisible)}>click
) } export default TitleToggle

ariannargesi avatar Jun 30 '20 12:06 ariannargesi

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

npm install @types/[email protected]

jason-dark avatar Jul 04 '20 22:07 jason-dark

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

ariel-walley avatar Jul 09 '20 04:07 ariel-walley

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

damikun avatar Jul 15 '20 12:07 damikun

From reading the docs CSSTransitionGroup and TransitionGroup are different.

jauggy avatar Aug 13 '20 22:08 jauggy

Are there any updates so far?

kirilavdeew avatar Sep 16 '20 08:09 kirilavdeew

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

MaribelleHGomez avatar Sep 25 '20 21:09 MaribelleHGomez

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'

Niicck avatar Oct 15 '20 16:10 Niicck

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

Frayion avatar Mar 17 '21 14:03 Frayion

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

silkfire avatar Jun 13 '21 16:06 silkfire

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

damikun avatar Jun 13 '21 17:06 damikun

try it >> http://reactcommunity.org/react-transition-group/transition

mariaammekarishvili avatar Jul 11 '22 09:07 mariaammekarishvili