iOS/Android pure javascript react-native component that renders your HTML into 100% native views
BSD-2-CLAUSE License
Bot releases are visible (Hide)
Published by jsamr over 3 years ago
RenderHTMLSharedProps
, useSharedProps
(7f57318)listPrefixRenderers
prop (98a04ca)RenderHTMLPassedProps
to RenderHTMLSharedProps
for consistency. In addition, changed signature of useSharedProps
and userRendererProps
. These hooks now take as first generic type arugment the shape of renderersProps
.listPrefixRenderers
prop has been discontinuated. You should use a custom renderer for lists instead.Published by jsamr over 3 years ago
source.uri
failing to cause HTML to loadallowWhitespaceNodes
prop to avoid removal of whitespace-filled text nodes (thanks @mysport12)baseFontStyle
updates (port from dev/4.x branch)Published by jsamr over 3 years ago
viewProps
(3134be1)cachedNaturalDimensions
prop to useIMGelementState
hook (eaca370)TRenderEngineProvider
and RenderHTMLFragment
components (38176ed)useIMGElementStateWithCache
hook for images (7958f43)useIMGElementState
hook (79e9158), closes #424
a
elements (69623c8), closes #285
useIMGElementState
hook (e4a0877)debug
is set to false (f5dd83c)Published by jsamr over 3 years ago
Published by jsamr over 3 years ago
Published by jsamr over 3 years ago
onPress
handling in TPhrasingRenderer (718d8a3)defaultViewProps
prop (d78a74b)target
argument to onLinkPress
handler (ae035f4)onDocumentMetadataLoaded
prop (14db262)domNodeToHTMLString
(54a100c)useDocumentMetadata
and useNormalizedUrl
hooks + source.baseUrl
prop for inline sources) (22220d4)Published by jsamr over 3 years ago
defaultTextProps
prop (13d7abf)useInternalRenderer
hook to reuse internal rendering logic (add307c)alterData
, alterChildren
and alterNode
(1e0002b)ignoreDOMNode
hook (8a0d14f)ignoredTags
prop (9d2f5d5)emSize
prop (f567532)extendDefaultRenderer
(eb565df)htmlParserOptions
prop (3e5de96)source
prop, identical to react-native-webview (ed74eb9)ignoreNodesFunction
has been renamed ignoreDOMNode
.
the names of hooks to alter DOM content have been changed for clarity:
alterData
becomes alterDOMData
alterChildren
becomes alterDOMChildren
alterNode
becomes alterDOMElement
dropped ptSize prop. Point is supposed to be an absolute (pixel independant) size and unfit for display devices. It will be translated by the CSS processor to an absolute unit.
containerStyle
and customContainer
props have been dropped. Use baseStyle
prop instead to style the root component.
drop textSelectable
and allowFontScaling
. Use defaultTextProps.selectable
and defaultTextProps.allowFontScaling
instead.
uri
and html
props have been dropped. Replace uri
with source={{ uri: 'http://...' }}
and html
with source={{ html: '<div> ...' }}
. The former now allows body
, headers
and method
fields.
decodeEntities
prop has been dropped. Pass this option to htmlParserOptions
prop instead.
computeImagesMaxWidth
has been replaced with computeEmbeddedMaxWidth
. The two props are very similar, but the latest takes an extra argument, "tagName", which is the tag for which a width constrain should be enforced. It is planned to work with the @native-html/iframe-plugin extension.
the object returned by splitBoxModelStyle
has more legible field names, boxModelStyle
and otherStyle
.
extendRenderer
has been renamed to extendDefaultRenderer
. Also note:
Published by jsamr almost 4 years ago
onParsed
, alterData
, alterChildren
(thanks @SPWizard01)Published by jsamr almost 4 years ago
Give us feedback on this release in the official thread
source
prop which deprecates html
and uri
props. This prop supports method
, body
and headers
fields 🚀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 “AcomputeEmbeddedMaxWidth
(see usage above).contentWidth
(see usage above).htmlParserOptions
to override htmlparser2 ParserOptions object, thanks @fabianlee1211.onLinkPress
has now a default value: open links with Linking
API (recommended).WebView
optional prop for plugins which requires it, see @native-html/plugins, thanksdefaultTextProps
, thanks @Peretz30
defaultWebViewProps
for WebView
-based plugins (tables, iframes...).constructStyles
, getParentsTagsRecursively
,getClosestNodeParentByTag
and IGNORED_TAGS
from index.js.domNode
field in passProps
.domNodeToHTMLString
util to get the HTML representation of a DOM node.TransientNode
) as well as onParsed
.img
's tag resizeMode
property not modifiable through tagStyles
, #172;imagesMaxWidth
not working, #412
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.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...).passProps
4th argument of renderer functions, the field rawChildren
has been renamed to transientChildren
.Published by jsamr almost 4 years ago
Published by jsamr almost 4 years ago
domNode
field in passProps
.domNodeToHTMLString
util to get the HTML representation of a DOM node.Published by jsamr almost 4 years ago
defaultWebViewProps
for WebView
-based plugins (tables, iframes...).Published by jsamr almost 4 years ago
PassProps
(Typescript)Published by jsamr almost 4 years ago
Published by jsamr almost 4 years ago
source
prop which deprecates html
and uri
props. This prop supports method
, body
and headers
fields 🚀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).contentWidth
(see usage above).htmlParserOptions
to overrideonLinkPress
has now a default value: open links with Linking
APIWebView
optional prop for plugins which requires it, see @native-html/plugins, thanks @IjzerenHein
defaultTextProps
, thanks @Peretz30
constructStyles
, getParentsTagsRecursively
, getClosestNodeParentByTag
and IGNORED_TAGS
from index.js.img
's tag resizeMode
property not modifiable through tagStyles
, #172;imagesMaxWidth
not working, #412
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.iframe
tag element is not rendered anymore, and react-native-webview
has@native-html/iframe-plugin
instead, which supports onLinkPress
and scales to content width 🚀.imagesMaxWidth
had been discontinued in favor of computeEmbeddedMaxWidth
. This function takes the provided contentWidth
as an argument, and returns the space the image should take.Published by jsamr almost 4 years ago
Published by jsamr almost 4 years ago
Published by jsamr almost 4 years ago
Track progress: https://github.com/archriss/react-native-render-html/pull/434#issue-527747509 and https://github.com/archriss/react-native-render-html/issues/430
Published by jsamr almost 4 years ago
Track progress: https://github.com/archriss/react-native-render-html/pull/434#issue-527747509 and https://github.com/archriss/react-native-render-html/issues/430
Published by jsamr almost 4 years ago
See https://github.com/archriss/react-native-render-html/pull/434#issue-527747509 and https://github.com/archriss/react-native-render-html/issues/430