v5.0.0
Give us feedback on this release in the official thread
Enhancements
- New
sourceprop which deprecateshtmlanduriprops. This prop supportsmethod,bodyandheadersfields 🚀 - Brand new
HTMLImagecomponent which should be much better at adapting its size to available width. For this to happen, you must passcontentWidthprop. We recommend usinguseWindowDimensions().widthto handle screen rotation gracefully. If you don't want your images to grow after a certain size, you could usecomputeEmbeddedMaxWidth. Read the RFC document “A
Deterministic Approach to Embedded Content Scaling” for more details. - New prop
computeEmbeddedMaxWidth(see usage above). - New prop
contentWidth(see usage above). - New prop
htmlParserOptionsto override htmlparser2 ParserOptions object, thanks @fabianlee1211. onLinkPresshas now a default value: open links withLinkingAPI (recommended).- Add Podspec file, thanks @systemride
- New
WebViewoptional prop for plugins which requires it, see @native-html/plugins, thanks
@IjzerenHein - New
defaultTextProps, thanks @Peretz30 - New
defaultWebViewPropsforWebView-based plugins (tables, iframes...). - Export
constructStyles,getParentsTagsRecursively,
getClosestNodeParentByTagandIGNORED_TAGSfrom index.js. - New
domNodefield inpassProps. - New
domNodeToHTMLStringutil to get the HTML representation of a DOM node. - The internal pre-render tree structure is now typed (
TransientNode) as well asonParsed.
Bugfixes
- Image getting blur on iOS, #141;
img's tagresizeModeproperty not modifiable throughtagStyles, #172;imagesMaxWidthnot working, #412
DEPRECATED PROPS (removed in v6)
allowFontScaling, usedefaultTextProps.allowFontScalinginstead;textSelectable, usedefaultTextProps.selectableinstead;decodeEntities, usehtmlParserOptions.decodeEntitiesinstead.html, usesource.htmlinstead.uri, usesource.uriinstead.
BREAKING CHANGES
- (TypeScript users), requires minimum TypeScript version 3.5 (was 2.0)
iframetag element is not rendered anymore, andreact-native-webviewhas been removed from peer dependencies; use@native-html/iframe-plugininstead, which supportsonLinkPressand scales to content width 🚀.imagesMaxWidthandstaticContentMaxWidthhave been discontinued in favor ofcomputeEmbeddedMaxWidth. This function takes the providedcontentWidthas 1st argument, tag name as 2d argument and returns the max width of the embedded (iframe, image...).- In the
passProps4th argument of renderer functions, the fieldrawChildrenhas been renamed totransientChildren.