Join Eve Porcello for an in-depth discussion in this video Using properties, part of Learn React.js: The Basics (2015).
- We can make our components more dynamic…by adding properties.…Sending properties to a component…is very similar to adding attributes…to HTML.…The first thing that we'll do…to demonstrate this, is we're going…to add text="Hello World"…on line 18.…On line 19 we will use text again,…but we'll send a different message,…"How are You?"…And finally, here on line 20,…we'll use text="Goodbye"…Now that we have all of these different…values defined, we want to use them somewhere.…
And the place we're going to use them…is here in our div.…First let's delete My React Component,…and we're going to add an h1,…and we're going to add a p.…Now, inside of our h1,…I'm going to open and close curly braces.…Inside of these curly braces,…I'm going to use this.props.text.…This .props helps us work with properties,…and text is just the name of the variables…that we created on lines 21 through 23.…
So if I save this,…and open this up in my browser,…we're going to see three different h1s,…all with different messages.…Props give us a way to reuse components…
- 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.