New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Material-UI Paper component does not recognize new line character #9189
Comments
@alexanderwhatley What is the value of |
Hey @m2mathew, sorry about that. The version of material-ui is 0.17.4, and the value of comment.text is "Hi how \n are you?" |
I used: <Typography
variant="body1"
style={{whiteSpace: 'pre-line'}}
>
{body}
</Typography> Reference: |
It seems like it worth additional prop on the "Typography" component. |
Make sure to put your string in a separate 'body' variable. Writing it in-line does not work. And you do not need explicit '\n' characters.
To allow tabs as well, use |
I am passing to the Material-UI Paper component a string that contains a new line character. However, the Paper component seems to be ignoring it, as it is not starting a new line. Is this behavior intentional, or is this a bug. The code in question is below (comment.text is the string in question):
The text was updated successfully, but these errors were encountered: