mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Update components-and-props.md
fb indent style
This commit is contained in:
committed by
Dan Abramov
parent
27ce7a9151
commit
1d74e43b2c
@@ -133,8 +133,9 @@ function Comment(props) {
|
||||
<div className="Comment">
|
||||
<div className="UserInfo">
|
||||
<img className="Avatar"
|
||||
src={props.author.avatarUrl}
|
||||
alt={props.author.name} />
|
||||
src={props.author.avatarUrl}
|
||||
alt={props.author.name}
|
||||
/>
|
||||
<div className="UserInfo-name">
|
||||
{props.author.name}
|
||||
</div>
|
||||
@@ -158,12 +159,13 @@ This component can be tricky to change because of all the nesting, and it is als
|
||||
|
||||
First, we will extract `Avatar`:
|
||||
|
||||
```js{3-5}
|
||||
```js{3-6}
|
||||
function Avatar(props) {
|
||||
return (
|
||||
<img className="Avatar"
|
||||
src={props.user.avatarUrl}
|
||||
alt={props.user.name} />
|
||||
src={props.user.avatarUrl}
|
||||
alt={props.user.name}
|
||||
/>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user