Using React State to change the css of an element - blog post example
A repo for a blog post explaining how to change CSS styling using React State.
It's a simple app of a single button, which when clicked, switches back and forth from having pointed to rounded corners.
The 'pointedCorners' state is created with a boolean value. When the button is clicked, the state changes to the opposite boolean value.
A class is then created which checks the current state of 'pointedCorners' and adds a different class to the button depending on the boolean value.