Files
react.dev/tips/13-false-in-jsx.md
Cheng Lou 7a794ae3cf docs remove link to wiki page
Also some minor writing changes.
2013-12-30 23:38:01 -05:00

715 B

id, title, layout, permalink, prev, next
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 contexts:

Renders as id="false":

/** @jsx React.DOM */
React.renderComponent(<div id={false} />, mountNode);

String "false" as input value:

/** @jsx React.DOM */
React.renderComponent(<input value={false} />, mountNode);

No child:

/** @jsx React.DOM */
React.renderComponent(<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>.