-2

Hello how can I divide it into 2 different lines? Then it's called inside of div in different class.

this.setState({errorMessage:"First Line. Second Line"});

Dennis Vash
  • 50,196
  • 9
  • 100
  • 118

1 Answers1

0

Use a <div> or <p> tag with <br /> tag. You can use any of the following:

this.setState({ errorMessage: <div>First Line.<br />Second Line</div> });
this.setState({ errorMessage: <p>First Line.<br />Second Line</p> });

A quick tip will be, don't use dangerouslySetInnerHTML, which might get you into more troubles.

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252