@16g/react-simple-format 中文文档教程
@16g/react-simple-format
简单格式组件,如 Ruby on Rails simple_format,灵感来自 rilkevb/react-simple-format
Installation
npm i --save @16g/react-simple-format
Usage
import SimpleFormat from '@16g/react-simple-format';
const text = "paragraph\n\nand another one";
<SimpleFormat text={text} />
Props
Props | Type | Default | Description |
---|---|---|---|
text | string | undefined | Text will be formatted simply |
wrapperTag | string | 'p' | HTML tag wraps paragraph of text |
prefix | node | undefined | Node prepended to paragraph |
postfix | node | undefined | Node appended to paragraph |
@16g/react-simple-format
Simple format component like Ruby on Rails simple_format inspired by rilkevb/react-simple-format
Installation
npm i --save @16g/react-simple-format
Usage
import SimpleFormat from '@16g/react-simple-format';
const text = "paragraph\n\nand another one";
<SimpleFormat text={text} />
Props
Props | Type | Default | Description |
---|---|---|---|
text | string | undefined | Text will be formatted simply |
wrapperTag | string | 'p' | HTML tag wraps paragraph of text |
prefix | node | undefined | Node prepended to paragraph |
postfix | node | undefined | Node appended to paragraph |