Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions content/docs/components-and-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ This component can be tricky to change because of all the nesting, and it is als
First, we will extract `Avatar`:

```js{3-6}
function Avatar(props) {
function Avatar({user}) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have not used de structuring in the page already? There are other places where we usually don't use destructuring as well.

return (
<img className="Avatar"
src={props.user.avatarUrl}
alt={props.user.name}
src={user.avatarUrl}
alt={user.name}
/>
);
}
Expand Down Expand Up @@ -194,12 +194,12 @@ function Comment(props) {
Next, we will extract a `UserInfo` component that renders an `Avatar` next to the user's name:

```js{3-8}
function UserInfo(props) {
function UserInfo({user}) {
return (
<div className="UserInfo">
<Avatar user={props.user} />
<Avatar user={props.author} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have already removed props from params and destructured it we won't have props?
PS: currently we are building beta.reactjs.org you can also use that.

<div className="UserInfo-name">
{props.user.name}
{user.name}
</div>
</div>
);
Expand Down