I want to put linebreaks in a placeholder for a textarea. According to this question & answer, I should add html entity wherever I want a line break. This seems to work when I try it in just HTML. However, I'm losing something when I try to put this in react / quite possibly in the translation from text -> javascript variable -> react rendered html.
Here's my code:
<textarea rows='6' defaultValue={this.state.text} placeholder={'Hello World; ' + 'How is it going?'} onChange={this.handleChange}> </textarea> However when I render this, the literal text shows up rather than a line break. If I edit it with inspect element, they all show up correctly after I make any change.. I'm putting this in a "{}" variable here because it's a fairly long multiline string I want to put in the placeholder value.
I'm still working through some of the variants to figure out the smallest reproducible example / if any simple changes fix it, but my react turnaround time is not great. Would appreciate it if anyone is able to reproduce, has run into this before, or knows more about html entities & javascript string rendering.