Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 633 Bytes

13-false-in-jsx.md

File metadata and controls

30 lines (22 loc) · 633 Bytes
id title layout permalink prev next
false-in-jsx
False in JSX
tips
false-in-jsx.html
initial-ajax.html
communicate-between-components.html

Here's how false renders in different situations:

Renders as id="false":

ReactDOM.render(<div id={false} />, mountNode);

String "false" as input value:

ReactDOM.render(<input value={false} />, mountNode);

No child:

ReactDOM.render(<div>{false}</div>, mountNode);

The reason why this one doesn't render as the string "false" as a div child is to allow the more common use-case: <div>{x > 1 && 'You have more than one item'}</div>.