Open gongchuncheng opened 5 years ago
version: 0.5.2 //Transition
didLeave() { const { didLeave } = this.props; didLeave(); } <TransitionMotion willEnter={this.willEnter.bind(this)} willLeave={this.willLeave.bind(this)} didLeave={this.didLeave.bind(this)} defaultStyles={this.getStyles('before')} styles={this.getStyles('after')}> { this.renderDom.bind(this) } </TransitionMotion>
//container
destroyToast() { const { node } = this.props; //node: another container render to body const unmountResult = ReactDOM.unmountComponentAtNode(node); if (unmountResult && node.parentNode) { node.parentNode.removeChild(node); } } <Transition show={show} isAnimate={this.isAnimate} type='toast' didLeave={this.destroyToast.bind(this)} > <div className="MI_toast-container"> <div className="MI_toast" >{ message }</div> </div> </Transition>
thanks~
This seems to be related to this: https://github.com/chenglou/react-motion/issues/567
The code fixing this unmounting issue is not in npm package manager
version: 0.5.2 //Transition
//container
thanks~