552 B
552 B
All newlines
<AddNewLines text="\n\n\n" />
Starting and ending with newlines
<AddNewLines text="\nin between\n" />
With newlines in the middle
<AddNewLines text="Before \n\n after" />
No newlines
<AddNewLines text="This is the text" />
Providing custom non-newline render function
const renderNonNewLine = ({ text, key }) => (
<span key={key}>This is my custom content!</span>
);
<AddNewLines
text="\n first \n second \n"
renderNonNewLine={renderNonNewLine}
/>;