one single child in ternary

This commit is contained in:
Cheng Lou 2013-10-07 23:35:29 -04:00 committed by Connor McSheffrey
parent 7db760427c
commit 119e29ff1d
2 changed files with 2 additions and 2 deletions

View File

@ -7,4 +7,4 @@ permalink: jsx-root-node-count-tip.html
Currently, in a component's `render`, you can only return one node; if you have, say, a list of `div`s to return, you must wrap your components within a `div`, `span` or any other component. Currently, in a component's `render`, you can only return one node; if you have, say, a list of `div`s to return, you must wrap your components within a `div`, `span` or any other component.
Don't forget that JSX compiles into regular js; returning two functions doesn't really make syntactic sense. Don't forget that JSX compiles into regular js; returning two functions doesn't really make syntactic sense. Likewise, don't put more than one child in a ternary.

View File

@ -12,4 +12,4 @@ You're getting a parsing error from JSX.
You might have tried to return more than one node in your component's `render`. Currently, you can only return one node, meaning that you must wrap your components within, say, a `div` or a `span` (or any other component). You might have tried to return more than one node in your component's `render`. Currently, you can only return one node, meaning that you must wrap your components within, say, a `div` or a `span` (or any other component).
### Discussion ### Discussion
Don't forget that JSX compiles into regular js; returning two functions doesn't really make syntactic sense. Don't forget that JSX compiles into regular js; returning two functions doesn't really make syntactic sense. Likewise, don't put more than one child in a ternary.