Answer the question
In order to leave comments, you need to log in
Why does react leave "0" on the page?
When the block is hidden, react leaves zero.
{ this.state.data.reply.length &&
<div className="reply">
<Posts messages={this.state.data.reply}/>
</div>
}
<!-- react-text: 57 -->
"0"
<!-- /react-text -->
Answer the question
In order to leave comments, you need to log in
this.state.data.reply.length
is 0, so 0 is output. Try this:
{!!this.state.data.reply.length &&
<div className="reply">
<Posts messages={this.state.data.reply}/>
</div>
}
{this.state.data.reply.length > 0 &&
<div className="reply">
<Posts messages={this.state.data.reply}/>
</div>
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question