diff --git a/docs/tips/03-if-else-in-JSX.md b/docs/tips/03-if-else-in-JSX.md index 0782b4b84a..a22a6cf818 100644 --- a/docs/tips/03-if-else-in-JSX.md +++ b/docs/tips/03-if-else-in-JSX.md @@ -30,7 +30,7 @@ React.createElement("div", {id: if (condition) { 'msg' }}, "Hello World!"); That's not valid JS. You probably want to make use of a ternary expression: ```js -ReactDOM.render(
Hello World!
, mountNode); +ReactDOM.render(
Hello World!
, mountNode); ``` If a ternary expression isn't robust enough, you can use `if` statements outside of your JSX to determine which components should be used: