Struggling with a form Login issue while working on React. The error I keep encountering is:
TypeError: Cannot read property 'classList' of undefined
The problematic snippet in my code is as follows:
changeState(){
const {isLogginActive} = this.state;
if(isLogginActive) {
this.rightSide.classList.remove("right");
this.rightSide.classList.add("left");
} else {
this.rightSide.classList.remove("left");
this.rightSide.classList.add("right");
}
this.setState((prevState)=> ({ isLogginActive: !prevState.isLogginActive }));
}
If anyone has encountered this issue and found a way to resolve it within the React framework, I would greatly appreciate your help.
Thank you.