<RenderHTML
contentWidth={width}
source={{
html: html,
}}
renderers={{ table: TableRenderer }}
WebView={WebView}
renderersProps={{
table: {
computeContainerHeight() {
return null;
},
webViewProps: {
style: {
backgroundColor: "transparent",
marginVertical: 10,
alignItems: "center",
borderWidth: 1,
borderColor: "lightgray",
},
nestedScrollEnabled: true,
scalesPageToFit: true,
bounces: false,
},
},
a: {
onPress(event, url, htmlAttribs, target) {
// Do stuff
if (url) {
openLink(url, colors.text, colors.background);
}
},
},
}}
customHTMLElementModels={{
table: tableModel
}}
systemFonts={[
Typography.MuseoSansRegularText,
Typography.MuseoSansBoldText,
]}
enableCSSInlineProcessing={enableCSSInlineProcessing}
baseStyle={contentHeight && { minHeight: contentHeight }}
tagsStyles={{
body: {
// width: "96%",
paddingHorizontal: 10,
fontWeight: "400",
fontFamily: Typography.MuseoSansRegularText,
lineHeight: 24,
alignSelf: "center",
fontSize: 16,
color: colors.text,
...bodyStyle,
},
p: {
fontWeight: "400",
fontFamily: Typography.MuseoSansRegularText,
lineHeight: 24,
fontSize: 16,
color: colors.text,
marginVertical: 0,
...paragraphStyle,
},
span: {
fontWeight: "400",
fontFamily: Typography.MuseoSansRegularText,
lineHeight: 24,
fontSize: 16,
color: colors.text,
},
div: {
fontWeight: "400",
fontFamily: Typography.MuseoSansRegularText,
lineHeight: 24,
fontSize: 16,
color: colors.text,
},
img: {
width: imgWidth || "100%",
resizeMode: "contain",
alignItems: "center",
},
table: commonStyles.table(colors),
tbody: commonStyles.tbody(colors),
td: commonStyles.td(colors),
tr: commonStyles.tr(colors),
th: commonStyles.th(colors),
thead: commonStyles.thead(colors),
tbody: commonStyles.tbody(colors),
}}
/>