{"action":"created","issue":{"url":"https://api.github.com/repos/chenglou/react-tween-state/issues/15","labels_url":"https://api.github.com/repos/chenglou/react-tween-state/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/chenglou/react-tween-state/issues/15/comments","events_url":"https://api.github.com/repos/chenglou/react-tween-state/issues/15/events","html_url":"https://github.com/chenglou/react-tween-state/issues/15","id":53673014,"number":15,"title":"Animate on unmount?","user":{"login":"irvinebroque","id":1221592,"avatar_url":"https://avatars.githubusercontent.com/u/1221592?v=3","gravatar_id":"","url":"https://api.github.com/users/irvinebroque","html_url":"https://github.com/irvinebroque","followers_url":"https://api.github.com/users/irvinebroque/followers","following_url":"https://api.github.com/users/irvinebroque/following{/other_user}","gists_url":"https://api.github.com/users/irvinebroque/gists{/gist_id}","starred_url":"https://api.github.com/users/irvinebroque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irvinebroque/subscriptions","organizations_url":"https://api.github.com/users/irvinebroque/orgs","repos_url":"https://api.github.com/users/irvinebroque/repos","events_url":"https://api.github.com/users/irvinebroque/events{/privacy}","received_events_url":"https://api.github.com/users/irvinebroque/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-07T19:43:17Z","updated_at":"2015-07-27T05:58:16Z","closed_at":"2015-07-27T05:58:16Z","body":"I'm using react-tween-state to animate components on mount, and it works great. But `componentWillUnmount` doesn't allow state manipulations, so the following code throws an invariant violation:\r\n\r\n      componentWillUnmount: function() {\r\n        this.tweenState('translateY', {\r\n          easing: tweenState.easingTypes.easeInOutQuad,\r\n          duration: 300,\r\n          endValue: this.state.translateY === 100 ? 300 : 0\r\n        });\r\n      }\r\n\r\nInvariant violation:\r\n\r\n    Uncaught Error: Invariant Violation: replaceState(...): Cannot update while unmounting component. This usually means you called setState() on an unmounted component.\r\n\r\nIs the solution to this to just use [react-state-stream](https://github.com/chenglou/react-state-stream), which handles unmounting? Trying to find an interim implementation -- one of the reasons I like react-tween-state is that animations can be defined easily as lifecycle methods, rather than wrapper components ala `<CSSTransitionGroup>`"},"comment":{"url":"https://api.github.com/repos/chenglou/react-tween-state/issues/comments/125095180","html_url":"https://github.com/chenglou/react-tween-state/issues/15#issuecomment-125095180","issue_url":"https://api.github.com/repos/chenglou/react-tween-state/issues/15","id":125095180,"user":{"login":"chenglou","id":1909539,"avatar_url":"https://avatars.githubusercontent.com/u/1909539?v=3","gravatar_id":"","url":"https://api.github.com/users/chenglou","html_url":"https://github.com/chenglou","followers_url":"https://api.github.com/users/chenglou/followers","following_url":"https://api.github.com/users/chenglou/following{/other_user}","gists_url":"https://api.github.com/users/chenglou/gists{/gist_id}","starred_url":"https://api.github.com/users/chenglou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenglou/subscriptions","organizations_url":"https://api.github.com/users/chenglou/orgs","repos_url":"https://api.github.com/users/chenglou/repos","events_url":"https://api.github.com/users/chenglou/events{/privacy}","received_events_url":"https://api.github.com/users/chenglou/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T05:58:16Z","updated_at":"2015-07-27T05:58:16Z","body":"https://github.com/chenglou/react-motion\r\n\r\n=)"}}