mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
12 lines
292 B
TypeScript
12 lines
292 B
TypeScript
import * as React from 'react';
|
|
|
|
export const ReactifyNewlines = (props: { children: string }) => {
|
|
const textArray = props.children.split('\n');
|
|
return (
|
|
<>
|
|
{textArray.map((part, idx) => (
|
|
<div key={`rifynl${idx}`}>{part || <> </>}</div>
|
|
))}
|
|
</>
|
|
);
|
|
};
|