When I receive a string like
1 2 <br /> 3 <br /> 4 4
, my goal is to display it in a textarea with LINE BREAKS
.
To see what I am attempting to achieve, please check out the jsfiddle link below: https://jsfiddle.net/pejxqn68/1/
class Hello extends React.Component {
render() {
return (
<div>
<textarea value={this.props.textareaValue}></textarea>
</div>
);
}
}
ReactDOM.render(
<Hello textareaValue="1 2 <br /> 3 <br /> 4 4" />,
document.getElementById('container')
);
Is there a way to show the string in the textarea while interpreting the br
tags as line breaks?
Edit -
As changing the textarea
to a div
is not an option for me, finding a solution using react
would be preferable.