Reputation: 6936
I am trying to create a multiline jsx variable
returnedElem = <StyledRemovedAnnotationDiv>
<p>{this.state.deletedAnnotation.objectRemoved.prediction}</p>
<button
className="btn btn-danger"
onClick={() => this.undoDelete(tax, deletedObj)}
>
Undo
</button>
</StyledRemovedAnnotationDiv>,
But this is not working. Please guide me.
Upvotes: 2
Views: 2830
Reputation: 5432
Try wrapping with braces:
returnedElem = (
<StyledRemovedAnnotationDiv>
<p>{this.state.deletedAnnotation.objectRemoved.prediction}</p>
<button
className="btn btn-danger"
onClick={() => this.undoDelete(tax, deletedObj)}
>
Undo
</button>
</StyledRemovedAnnotationDiv>
)
Upvotes: 3