booleans (true/false), null, and undefined are valid children, they will be Ignored means they simply don’t render.
All these JSX expressions will render to the same thing:
<div />
<div></div>
<div>{false}</div>
<div>{null}</div>
<div>{undefined}</div>
<div>{true}</div>
网友评论