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:
Lewis Blackwood
2016-10-27 13:15:39 +01:00
committed by Dan Abramov
parent a8fc7d80e2
commit 48949f35c5
+1 -1
View File
@@ -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>;
}