Skip to content

Using React State to change the css of an element - blog post example

Notifications You must be signed in to change notification settings

LauraToddCodes/Changing-Styling-Using-React-State

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Changing Styling Using React State

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.

About

Using React State to change the css of an element - blog post example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published