{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/2292","labels_url":"https://api.github.com/repos/facebook/react/issues/2292/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/2292/comments","events_url":"https://api.github.com/repos/facebook/react/issues/2292/events","html_url":"https://github.com/facebook/react/issues/2292","id":44912859,"number":2292,"title":"Removing -leave classes in CSSTransitionGroup doesn't work well with alternative batching strategies","user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react/labels/Component:%20Addons%20/%20TransitionGroup","name":"Component: Addons / TransitionGroup","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-10-05T12:22:55Z","updated_at":"2015-04-01T22:05:28Z","closed_at":"2015-04-01T22:05:28Z","body":"Hi,\r\n\r\nThis is probably by design but I wanted to make sure.\r\n\r\nI had a problem with using `CSSTransitionGroup` together with RAF batching strategy. I'm aware that RAF batching is not officially supported but it works very well for me and solves quite a few problems in my app so I don't want to give it up.\r\n\r\nThe problem is following: `CSSTransitionGroup` [removes](https://github.com/facebook/react/blob/master/src/addons/transitions/ReactCSSTransitionGroupChild.js#L67) `-leave` and `-leave-active` classes just before calling `finishCallback()`. Is it really necessary to do so?\r\n\r\nWith batching strategy other than default, this may (and does with RAF) result in `-leave` and `-leave-active` classes being removed *a tick before* element is removed from the DOM. Thus the element flickers.\r\n\r\nIf I move these calls behind a condition, transition group behaves just fine:\r\n\r\n```javascript\r\nif (animationType !== 'leave') {\r\n  CSSCore.removeClass(node, className);\r\n  CSSCore.removeClass(node, activeClassName);\r\n}\r\n```\r\n\r\nAm I missing something?\r\n\r\n**Edit:** Indeed, I am missing the situation where I fire another `enter` before `leave` completes—probably in this case my `if` won't work. But still I wish there was a way around this."},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/88646744","html_url":"https://github.com/facebook/react/issues/2292#issuecomment-88646744","issue_url":"https://api.github.com/repos/facebook/react/issues/2292","id":88646744,"user":{"login":"spicyj","id":6820,"avatar_url":"https://avatars.githubusercontent.com/u/6820?v=3","gravatar_id":"","url":"https://api.github.com/users/spicyj","html_url":"https://github.com/spicyj","followers_url":"https://api.github.com/users/spicyj/followers","following_url":"https://api.github.com/users/spicyj/following{/other_user}","gists_url":"https://api.github.com/users/spicyj/gists{/gist_id}","starred_url":"https://api.github.com/users/spicyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spicyj/subscriptions","organizations_url":"https://api.github.com/users/spicyj/orgs","repos_url":"https://api.github.com/users/spicyj/repos","events_url":"https://api.github.com/users/spicyj/events{/privacy}","received_events_url":"https://api.github.com/users/spicyj/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T22:05:28Z","updated_at":"2015-04-01T22:05:28Z","body":"I'm having enough trouble convincing myself that your fix is correct that I don't think I want to take this. If we ever support rAF batching in core, perhaps we will want a fix for this. I'm curious though – what problems does rAF batching solve for you? Does React.addons.batchedUpdates fix the same problems?"}}