False in JSX Back

In React, false renders different things in different situation:

as id="false":

ReactDOM.render(
    <div id={false} />,
    document.getElementById('content')
);

as string input value:

ReactDOM.render(
    <input value={false} />,
    document.getElementById('content')
);

as no child:

ReactDOM.render(
    <div>{false}</div>,
    document.getElementById('content')
);

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

Empty Comments
Sign in GitHub

As the plugin is integrated with a code management system like GitLab or GitHub, you may have to auth with your account before leaving comments around this article.

Notice: This plugin has used Cookie to store your token with an expiration.