mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 09:59:10 +00:00
chore: move src/common/utils to @roleypoly/misc-utils
This commit is contained in:
parent
a374030438
commit
65a8760e86
36 changed files with 38 additions and 465 deletions
12
packages/misc-utils/ReactifyNewlines.tsx
Normal file
12
packages/misc-utils/ReactifyNewlines.tsx
Normal file
|
@ -0,0 +1,12 @@
|
|||
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>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue