You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
addClass(node,type,phase){letclassName=this.getClassNames(type)[`${phase}ClassName`];const{ doneClassName }=this.getClassNames('enter');if(type==='appear'&&phase==='done'&&doneClassName){className+=` ${doneClassName}`;}// This is to force a repaint,// which is necessary in order to transition styles when adding a class name.if(phase==='active'){/* eslint-disable no-unused-expressions */node&&node.scrollTop;}if(className){this.appliedClasses[type][phase]=classNameaddClass(node,className)}}
Output code (bundle.00407.js) (unminified by prettier, annotated by me):
Do you want to request a feature or report a bug?
Bug
What is the current behaviour?
Transitions in react-transition-group only works in dev mode, but not in prod mode.
Checking the output file, some side-effect code in react-transition-group has been removed by the bundler:
Original code:
https://github.com/reactjs/react-transition-group/blob/399f26998a5cf2449798a02c755e5808e9b39ddd/src/CSSTransition.js#L185-L204
Output code (bundle.00407.js) (unminified by prettier, annotated by me):
If the current behaviour is a bug, please provide the steps to reproduce.
npx preact-cli create simple transition-repro
cd transition-repro
npm i react-transition-group
style.css
CSSTransition
component toindex.js
npm run build
I created a repository containing all files produced by above steps: https://github.com/yume-chan/preact-transition-repro
What is the expected behaviour?
The transition work in both dev and prod mode.
If this is a feature request, what is motivation or use case for changing the behaviour?
N/A
Please mention other relevant information.
#505
Please paste the results of
preact info
here.The text was updated successfully, but these errors were encountered: