Join Eve Porcello for an in-depth discussion in this video Using state, part of Learn React.js: The Basics (2015).
- One of the most important React concepts is state.…When a component state data changes,…the render function will be called again…to re-render the change in state.…On line 11 here, we've created…a component called Checkbox,…and right now it's returning a div.…Inside of this div, we want to add…an input and we're going to…give it a type of checkbox.…Following this on line 15, we're going…to create a p tag, and we're going…to come back and use this a little bit later.…
A checkbox is a great demonstration of state.…It has two states: checked and unchecked.…Now we're going to add some new…methods to our component, so that…we can make it a state full component.…On line 12, I'll add this method…called getInitialState.…This function is going to return…an object, and inside of this object…we're going to initialize the default state.…So I'm going to make this checked: false.…
So when our application loads,…the checkbox will be unchecked.…The next thing we want to use is…a custom method called handleCheck.…This is, again, a function that is going to…
- What is React.js?
- Introducing JSX
- Creating a React component
- Handling events
- Using state
- Defining parent/child relationships
- Adding child elements
- Mounting and updating components
- Creating a React.js app
Skill Level Beginner
Up and Running with AngularJS 1with Ray Villalobos1h 20m Intermediate
1. What is React.js?
2. Getting Started
3. React Components
4. Parent/Child Relationships
5. Component Life Cycle
6. Creating an App
Next steps1m 5s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.