I'm sending an API request and render its result in to UI.
Now, for the error-handling, I wanted that if there is an error a div which contains an error message gets rendered in to the UI.
To achieve this I wrote the following ternary condition:
const showError = this.state.error
? `<div className="error-container">
Error:
<p>{this.state.error}</p>
</div>`
: '';
And then used this inside my render method: {showError}
But React see the result as a string and renders the following to the UI:
What am I doing wrong?
