I already have a state with this:
this.setState({
conversation:
(
<div>
{conversation.map(element => {
if (element.id === this.props.id) {
return(
<div className="row msg_container base_sent">
<div className="col-md-10 col-xs-10">
<div className="messages msg_sent">
<p>{element.message}</p>
</div>
</div>
</div>
)
}
else {
return(
<div className="row msg_container base_receive">
<div className="col-md-10 col-xs-10">
<div className="messages msg_receive">
<p>{element.message}</p>
</div>
</div>
</div>
)
}
})}
</div>
)
})
Now I would like to update it with new information. So add another div to it.
Something like that:
this.setState({conversation: previousConversation + new div})
How can I do it? Or I need to set a new state from zero