Skip to content

Instantly share code, notes, and snippets.

@magsout
Created March 27, 2018 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magsout/b46704327ecdbecdfbf92b2143bf151b to your computer and use it in GitHub Desktop.
Save magsout/b46704327ecdbecdfbf92b2143bf151b to your computer and use it in GitHub Desktop.
import React from "react"
const NewlineToBreak = props => {
const { text } = props
return (
<span>
{text.split("\n").map((item, key) => <span key={key}>{item}<br /></span>)}
</span>
)
}
export default NewlineToBreak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment