mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Adds minor additions clarifying questions I had reading intro tutorial (#7595)
This commit is contained in:
committed by
Paul O’Shannessy
parent
557f06e044
commit
05138ac33a
@@ -181,7 +181,7 @@ Notice how we're mixing HTML tags and components we've built. HTML components ar
|
||||
|
||||
### Using props
|
||||
|
||||
Let's create the `Comment` component, which will depend on data passed in from its parent. Data passed in from a parent component is available as a 'property' on the child component. These 'properties' are accessed through `this.props`. Using props, we will be able to read the data passed to the `Comment` from the `CommentList`, and render some markup:
|
||||
Let's create the `Comment` component, which will depend on data passed in from its parent, `CommentList`. Data passed in from a parent component is available as a 'property' on the child component. These 'properties' are accessed through `this.props`. Using props, we will be able to read the data passed to the `Comment` from the `CommentList`, and render some markup:
|
||||
|
||||
```javascript
|
||||
// tutorial4.js
|
||||
@@ -219,7 +219,7 @@ var CommentList = React.createClass({
|
||||
});
|
||||
```
|
||||
|
||||
Note that we have passed some data from the parent `CommentList` component to the child `Comment` components. For example, we passed *Pete Hunt* (via an attribute) and *This is one comment* (via an XML-like child node) to the first `Comment`. As noted above, the `Comment` component will access these 'properties' through `this.props.author`, and `this.props.children`.
|
||||
Note that we have passed some data from the parent `CommentList` component to the child `Comment` components. For example, we passed *Pete Hunt* (via the `author` attribute) and *This is one comment* (via an XML-like child node) to the first `Comment`. As noted above, the `Comment` component will access these 'properties' through `this.props.author`, and `this.props.children`.
|
||||
|
||||
### Adding Markdown
|
||||
|
||||
|
||||
Reference in New Issue
Block a user