Skip to content

Demonstrate lifting state up and "thinking in react" by maintaining state where needed and using props to push state down to children.

Notifications You must be signed in to change notification settings

mdoery/react-radio-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This project demonstrates lifting state up and "thinking in react" by maintaining state where needed and using props to push state down to children.

The App class maintains state, higher up the DOM hierarchy. Radio buttons do not maintain their own state; they are "instructed" how to be set by props, which are sent from the parent.

When the user clicks a radio button, the changed value is lifted up through several layers of classes into the App. If the app were fleshed out, this state might be saved to a datastore on a server. In this case, it's just stored as state and redisplayed in the browser.

Here is a view:

view

Other info

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

About

Demonstrate lifting state up and "thinking in react" by maintaining state where needed and using props to push state down to children.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published