iOS/Android pure javascript react-native component that renders your HTML into 100% native views
BSD 2-Clause "Simplified" License
3.48k
stars
589
forks
source link
When I use customRender To replace a to div it doesn's work, or wrap a tag. #578
Closed
jamninetyfive closed 2 years ago
Decision Table
<yyy>
is not rendered”Good Faith Declaration
Description
When I use customRender To replace a to div it doesn's work, or wrap a tag.
React Native Information
RNRH Version
6.3.4
Tested Platforms
Reproduction Platforms
Minimal, Reproducible Example
const htmlTpl =
<a href="action1" style="outline: none;text-decoration: none;color:#fff;width: 72px;height:24px;line-height:24px;text-align:center;font-size:10px;background:#49C167;border-radius: 20px;">text</a>
const onPress = () => Toast.show(11111)
// (TypeScript) Notice the type for intellisense const DivRenderer: CustomBlockRenderer = function DivRenderer({ TDefaultRenderer, ...props }) { return <TDefaultRenderer {...props} onPress={onPress} />; }
const renderers = { a: DivRenderer };
<RenderHTML contentWidth={230} source={ { html: htmlView } } renderersProps={renderers} />
Additional Notes
i wanna replace a to div. or add onpress to div.
both doesn't work. need help .please