Skip to content

v5.0.0

Compare
Choose a tag to compare
@jsamr jsamr released this 05 Dec 17:16
· 899 commits to master since this release

Give us feedback on this release in the official thread

Enhancements

  • New source prop which deprecates html and uri props. This prop supports method, body and headers fields 🚀
  • Brand new HTMLImage component which should be much better at adapting its size to available width. For this to happen, you must pass contentWidth prop. We recommend using useWindowDimensions().width to handle screen rotation gracefully. If you don't want your images to grow after a certain size, you could use computeEmbeddedMaxWidth. 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 htmlParserOptions to override htmlparser2 ParserOptions object, thanks @fabianlee1211.
  • onLinkPress has now a default value: open links with Linking API (recommended).
  • Add Podspec file, thanks @systemride
  • New WebView optional prop for plugins which requires it, see @native-html/plugins, thanks
    @IjzerenHein
  • New defaultTextProps, thanks @Peretz30
  • New defaultWebViewProps for WebView-based plugins (tables, iframes...).
  • Export constructStyles, getParentsTagsRecursively,
    getClosestNodeParentByTag and IGNORED_TAGS from index.js.
  • New domNode field in passProps.
  • New domNodeToHTMLString util to get the HTML representation of a DOM node.
  • The internal pre-render tree structure is now typed (TransientNode) as well as onParsed.

Bugfixes

  • Image getting blur on iOS, #141;
  • img's tag resizeMode property not modifiable through tagStyles, #172;
  • imagesMaxWidth not working, #412

DEPRECATED PROPS (removed in v6)

  • allowFontScaling, use defaultTextProps.allowFontScaling instead;
  • textSelectable, use defaultTextProps.selectable instead;
  • decodeEntities, use htmlParserOptions.decodeEntities instead.
  • html, use source.html instead.
  • uri, use source.uri instead.

BREAKING CHANGES

  • (TypeScript users), requires minimum TypeScript version 3.5 (was 2.0)
  • iframe tag element is not rendered anymore, and react-native-webview has been removed from peer dependencies; use @native-html/iframe-plugin instead, which supports onLinkPress and scales to content width 🚀.
  • imagesMaxWidth and staticContentMaxWidth have been discontinued in favor of computeEmbeddedMaxWidth. This function takes the provided contentWidth as 1st argument, tag name as 2d argument and returns the max width of the embedded (iframe, image...).
  • In the passProps 4th argument of renderer functions, the field rawChildren has been renamed to transientChildren.