Join Eve Porcello for an in-depth discussion in this video Updating and removing notes through props, part of Learn React.js: The Basics (2015).
- Just as our child components…can inherit state form their parents,…they also can inherit props.…Let's go to our board component,…and we're going to add a few more methods here.…These new functions are going to help us…update and remove notes from our board.…The first thing we'll add here on line 69 here is update.…And our update function is going to take in…newText and i.…On line 70, we want to create a new variable called…array, a-r-r,…which we'll set equal to this.state.notes,…so this is going to store the state of our notes.…
The next thing we want to do here on line 71…is we want to use arr…and then use the index of i,…and we're going to set this = newText.…This is going to use our current position in our array,…and it's going to set newText.…So once we have created this,…we're going to use this.setState,…and inside of setState, we're going to use…notes:arr,…so this is going to update…the state of our notes array.…
The next thing that we wanna do here…is we want to add a remove function,…so if I wanna delete any notes from my board,…
- 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?
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.