Skip to content

render nothing if the param is the number zero #37

@xdbobname

Description

@xdbobname

In react, the number zero will be rendered directly, rather than taken as false or null.

let items = ['one', 'two', 'three']; document.body.innerHTML = ( <div class="foo"> <h1>Hi!</h1> <p>Here is a list of {items.length} items:</p> <ul> { items.map( item => ( <li>{ 1 }</li> )) } </ul> </div> );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions