wish of those help I'm creating a simple hamburger menu and I want to add new className to element when onClick event occurs. This new className should transform the element, but when onClick occurs element dissapears, animation doesn't work. I understand the problem is in classes.line[i] part, but what could be the problem maybe someone can help me here. , If I change the line you marked to the following, it works:
To fix the issue you can do Since Card is a separate component, you should keep it declare it outside of your render method. But the problem is that you're passing an onClick function to a component but you're not hooking up that onClick function to the HTML element (in this case the ).