I have a React application. I'm trying to figure out how to render a string from an object with bold tags. When I render the data, the renderer picks up on the new lines tag, but ignores the bold tags and literally prints them as text... example: hi
How can I render out my content string with bold tags? Should I be storing the string differently? Below is my data and the render function
const imgPath = '.app/img/';
const Data = {
{
name: 'helpdesk',
title: 'Help Desk',
content: `Welcome to the <b>Help Desk</b>.\n\n From here you will be able to troubleshoot various problems.\n\n`,
image: `${imgPath}helpDesk.PNG`
}
}
export default Data;
Render
const renderHelpFile = this.props.data.filter(obj => {
return this.props.name === obj.name;
}).map((obj, idx) => {
return (
<div key={idx} className="fadingDiv">
<div className="displayLineBreak">
<h2 style={upperStyle}> {obj.name} </h2>s
{obj.content}
</div>
<div className="divImg">
<img src={`${obj.image}`} className="helpFileImg" onClick={this.openModal}></img><br />
<Modal
isOpen={this.state.modalIsOpen}
onAfterOpen={this.afterOpenModal}
onRequestClose={this.closeModal}
style={customStyles}
contentLabel="Lewis Controls"
>
<center>
<p style={upperStyle} className="modalTitle">{obj.name}</p>
<div className="imgModal"><img src={`${obj.image}`} className="helpFileImg"></img></div>
</center>
</Modal>
</div>
</div>
);
});