I'm new to react and i need to change CSS classes before component unmount but my component recieves new props before unmounting and the css effect doesn't appear any solution please .Thanks in advance
getNext=()=>{
this.setState({
isCardFadeOut: true
})
this.secondCard.current.classList.remove('second-card')
this.secondCard.current.classList.add('main-card')
this.thirdCard.current.classList.remove('third-card')
this.thirdCard.current.classList.add('second-card')
this.props.parent.getNext()
}