Browse Source

Fix typo in If/Else JSX doc.

main
Kurt Ruppel 10 years ago
parent
commit
902199d29a
  1. 2
      tips/03-if-else-in-JSX.md

2
tips/03-if-else-in-JSX.md

@ -24,7 +24,7 @@ This means that `if` statements don't fit in. Take this example:
<div id={if (condition) { 'msg' }}>Hello World!</div>
// Is transformed to this JS:
React.createElement("dov", {id: if (condition) { 'msg' }}, "Hello World!");
React.createElement("div", {id: if (condition) { 'msg' }}, "Hello World!");
```
That's not valid JS. You probably want to make use of a ternary expression:

Loading…
Cancel
Save