Browse Source

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)`.
main
Lewis Blackwood 8 years ago
committed by Dan Abramov
parent
commit
3aa40ba6a3
  1. 2
      docs/introducing-jsx.md

2
docs/introducing-jsx.md

@ -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>;
}

Loading…
Cancel
Save