当描述为空时,我不想呈现标题
var description = <MyElement />; // render will return nothing in render in some cases
if (!description) { // this will not work because its an object (reactelement)
return null;
}
<div>
{title}
{description}
</div>
如何正确检查一个变量是否为空,而不是使用!description?