I have a component in react js project which displays some text. the text variable is of type string and has some tab escape charcters within. I would like to replace this tab character and use a div . how do i replace this with a
such that when it renders , it outputs the div within the when it renders HTML. so on the page source in browser i see something like this => <span> once upon a time, <div> there was a man <div> who had a house. </span>
text = "once upon a time, \t there was a man \t who had a house." ;
class somcomponent extends React.Component {
render() {
return <span> {text}</span>;
}
}