This is a simple snippet to use when you want to show pre comments to avoid HTML line breaks or white spaces

In HTML

style="white-space: 'pre-wrap'; font-family: inherit; font-size: inherit"

 

In React:

style={{ whiteSpace: 'pre-wrap', 'fontFamily': "inherit", 'fontSize': "inherit" }}

 

Example React:

<pre className="alert alert-light" style={{ whiteSpace: 'pre-wrap', 'fontFamily': "inherit", 'fontSize': "inherit" }}>{item.cardDetailedText}</pre>