You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Making your custom component block or inline](#making-your-custom-component-block-or-inline)
19
20
-[Lists prefixes](#lists-prefixes)
20
21
-[Styling](#styling)
21
22
-[Images](#images)
@@ -126,6 +127,21 @@ Your renderers functions receive several arguments that will be very useful to m
126
127
*`convertedCSSStyles` : conversion of the `style` attribute from CSS to react-native's stylesheet
127
128
*`passProps` : various useful information : `groupInfo`, `parentTagName`, `parentIsText`...
128
129
130
+
### Making your custom component block or inline
131
+
132
+
By default, a custom renderer behaves like a block. So if you're rendering it between texts inside a `<p>`, you'll break your line.
133
+
134
+
If you want it to be inline, you can slightly change the way you declare it, like this :
135
+
136
+
```javascript
137
+
renderers: {
138
+
mytag: { renderer: myTagRenderer, wrapper:'Text' }, // new way, is inline
139
+
myothertag: myOtherTagRenderer // old regular way (still valid, behaves like a block)
140
+
}
141
+
```
142
+
143
+
> Note : the only values for `wrapper` are `Text` or `View` (default). Those don't represent the `<View>` and `<Text>` component of react-native but are instead used in the parser to prevent crashes and properly render every HTML markup.
144
+
129
145
### Lists prefixes
130
146
131
147
The default renderer of the `<ul>` and `<ol>` tags will either render a bullet or the count of your elements. If you wish to change this without having to re-write the whole list rendering implementation, you can use the `listsPrefixesRenderers` prop.
0 commit comments