I have TextField
with a helperText
. I want to make the helperText
span multiple lines. For that I needs some kind of line break. Material-UI renders <p>{ helperText }</p>
. Since in html line breaks in paragraphs are given by <br/>
I tried to add that to my text. This however just adds the <br/>
into the text. I also tried defining the helperText
outside the component, once with the <br/>
and once with \n
. But that didn't work either.
How do I properly add a line break into the helperText
?
Example of my code:
<TextField
name={"help message"}
value={data_field.helper_text}
onChange={(event) => handleDataChange("helper_text", event.target.value)}
helperText={"The value will be shown be shown below the field, just like this text is.<br> This <br/> text should go in the second line."}
/>
Example of result:
using CSS/JSS
– Vaibhav Apr 26 '21 at 09:43