Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render nothing if the param is the number zero #37

Open
xdbobname opened this issue Oct 10, 2022 · 0 comments
Open

render nothing if the param is the number zero #37

xdbobname opened this issue Oct 10, 2022 · 0 comments

Comments

@xdbobname
Copy link

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> );

odinhb added a commit to dodoas/stringjsx that referenced this issue Mar 8, 2024
fixes developit#40
and developit#37

inspired by developit#41

The only place we don't have parity right now is arrays (because that's
how children are passed) and bigint (because I'm not gonna do dependency
wrangling rn)
odinhb added a commit to dodoas/stringjsx that referenced this issue Mar 8, 2024
fixes developit#40
and developit#37

inspired by developit#41

The only place we don't have parity right now is arrays (because that's
how children are passed) and bigint (because I'm not gonna do dependency
wrangling rn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant