mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Correct usage of formatName() function in docs (#8122)
The code section above these changes defines a `formatName` function that expects a parameter `user`. The code section containing these changes incorrectly called `formatName(user.name)`. For those following along with CodePen, this section should correctly call `formatName(user)`.
This commit is contained in:
committed by
Dan Abramov
parent
a8fc7d80e2
commit
48949f35c5
@@ -59,7 +59,7 @@ This means that you can use JSX inside of `if` statements and `for` loops, assig
|
||||
```js{3,5}
|
||||
function getGreeting(user) {
|
||||
if (user) {
|
||||
return <h1>Hello, {formatName(user.name)}!</h1>;
|
||||
return <h1>Hello, {formatName(user)}!</h1>;
|
||||
} else {
|
||||
return <h1>Hello, Stranger.</h1>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user