2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-14 18:42:24 +03:00

feat(react): allow pass custom options to react component

This commit is contained in:
Nikolay Kostyurin
2018-10-25 16:39:49 +02:00
parent 6d37793001
commit 77b30f3d44
3 changed files with 10 additions and 8 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ import {render} from 'react-dom'
import bbobReactRender from '@bbob/react/es/render'
import presetReact from '@bbob/preset-react'
console.log(render(<span>{bbobReactRender(`[i]Text[/i]`, presetReact())}</span>)); // <span><span style="font-style: italic;">Text</span></span>
console.log(render(<span>{bbobReactRender(`[i]Text[/i]`, presetReact(), { onlyAllowTags: ['i'] })}</span>)); // <span><span style="font-style: italic;">Text</span></span>
```
### Presets <a name="basic"></a>
@@ -165,7 +165,7 @@ import BBCode from '@bbob/react/es/Component'
import reactPreset from '@bbob/preset-react/es'
const MyComponent = () => (
<BBCode plugins={[reactPreset()]}>
<BBCode plugins={[reactPreset()]} options={{ onlyAllowTags: ['i'] }}>
[quote]Text[/quote]
</BBCode>
)