Material-UI Paper component does not recognize new line character
See original GitHub issueI 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):
<Paper key={index} rounded={false} style={styles.paper}>
<div>{comment.text}</div>
<div style={{textAlign: 'right', color: grey500}}>{comment.user + ", " + comment.date}</div>
</Paper>
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Material-UI Paper component does not recognize new line ...
I am passing to the Material-UI Paper component a string that contains a new line character. However, the Paper component seems to be ......
Read more >New line '\n' not recognized inside TextField in React
Try using <p> to display ur descriptions. It automatically makes a new line for each element.
Read more >Typography API - Material UI - MUI
Typography API. API reference docs for the React Typography component. Learn about the props, CSS, and other APIs of this exported module.
Read more >React Text Field component - Material UI - MUI
The TextField wrapper component is a complete form control including a label, input, and help text. It comes with three variants: outlined (default), ......
Read more >TextField API - Material UI - MUI
Name Type Default
autoComplete string
autoFocus bool false
classes object
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I used:
style={{whiteSpace: 'pre-line'}}
Reference: https://stackoverflow.com/questions/39325414/line-break-in-html-with-n
It seems like it worth additional prop on the “Typography” component.