Join Eve Porcello for an in-depth discussion in this video Adding new notes, part of Learning React.js.
- [Woman] Now that our Bulletin Board app…allows us to edit and remove notes,…I want to create a solution for adding notes.…So the first step of that is we're going to remove…all of these notes, and just return our notes…as an empty array because we're not going to be…auto-generating these anymore,…we're going to be adding them.…The next thing I'll do is I'll add a method called add.…And add is going to take in the text so the new text…of the note that we're adding, and then inside…of our add method we're going to create a variable…called notes, and this is going to be set…equal to an array.…
Now in the first position of this array…we're going to send this.state.notes…using the spread operator from ES6.…The spread operator is going to take whatever…is in the state of notes, whether that's one note…or a hundred notes, and it's going to make those…the first items in the array,…and then we're going to add on this new item…in the array, an object with an ID and note.…So note is going to be set to text,…ID we need to set up a new method to handle…
- What is React.js?
- Introducing JSX
- Creating a React component
- Handling events
- Using state
- Working with PropTypes
- Adding child elements
- Mounting and updating components
- Creating a React.js app
Skill Level Beginner
Building a Web Interface with React.jswith Ray Villalobos1h 21m Intermediate
1. What Is React.js?
2. Getting Started
3. React Components
4. Props and State
5. Enhancing Components
6. Creating an App
Using create-react-app4m 38s
Next steps1m 4s
- 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.