react-native-render-html icon indicating copy to clipboard operation
react-native-render-html copied to clipboard

ERROR Warning: bound renderChildren: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

Open nguyenvuhoang opened this issue 7 months ago • 6 comments

Decision Table

  • [x] My issue does not look like “The HTML attribute 'xxx' is ignored” (unless we claim support for it)
  • [x] My issue does not look like “The HTML element <yyy> is not rendered”

Good Faith Declaration

  • [x] I have read the HELP document here: https://git.io/JBi6R
  • [x] I have read the CONTRIBUTING document here: https://git.io/JJ0Pg
  • [x] I have confirmed that this bug has not been reported yet

Description

ERROR Warning: bound renderChildren: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

React Native Information

<RenderHTML
          contentWidth={screenWidth - 32}
          source={{ html: `<div>${item.message}</div>` }}
          tagsStyles={htmlTagStyles}
          defaultTextProps={{ selectable: false }}
          enableExperimentalMarginCollapsing={true}
        />

RNRH Version

<RenderHTML contentWidth={screenWidth - 32} source={{ html: <div>${item.message}</div> }} tagsStyles={htmlTagStyles} defaultTextProps={{ selectable: false }} enableExperimentalMarginCollapsing={true} />

Tested Platforms

  • [x] Android
  • [x] iOS
  • [ ] Web
  • [ ] MacOS
  • [ ] Windows

Reproduction Platforms

  • [x] Android
  • [x] iOS
  • [ ] Web
  • [ ] MacOS
  • [ ] Windows

Minimal, Reproducible Example

<RenderHTML contentWidth={screenWidth - 32} source={{ html: <div>${item.message}</div> }} tagsStyles={htmlTagStyles} defaultTextProps={{ selectable: false }} enableExperimentalMarginCollapsing={true} />

Additional Notes

No response

nguyenvuhoang avatar Apr 21 '25 15:04 nguyenvuhoang

I have the same issue when I switched from expo SDK 51 to SDK 52 and respectively from React 18.2.0 to React 18.3.1 and React Native 0.74.5 to React Native 0.76.9

denchev avatar Apr 26 '25 05:04 denchev

I have the same issue when I switched from expo SDK 51 to SDK 52 and respectively from React 18.2.0 to React 18.3.1 and React Native 0.74.5 to React Native 0.76.9

Just got the same issue. Is this library still being maintained?

vinicfrancisco avatar Apr 29 '25 12:04 vinicfrancisco

the developer doesn't care about his module? when will the error be fixed?

eeeman1 avatar May 15 '25 10:05 eeeman1

Bump

luco avatar May 15 '25 19:05 luco

I created a fix that needs to be reviewed and merged. You can view the test repository here https://github.com/tristanheilman/react-native-render-html-684-test/releases

Included in the repo is a yarn patch file. You can also refer to this branch for the changes: https://github.com/tristanheilman/react-native-render-html/tree/support-RN75

Unfortunately I'm unsure how to make this repository work as a git fork with a git link in the package.json. If somebody figures that out, would be greatly appreciated. At the moment I need to installed the forked repository locally like so:

"react-native-render-html": "../react-native-render-html/packages/render-html",

OR you can utilize a patch by running yarn patch react-native-render-html and then open up the file and paste in the lib , src and package.json files over from the support-RN75 repository branch. If you do not see a lib folder, then you need to cd into the packages/render-html folder and run yarn && yarn build

tristanheilman avatar May 23 '25 02:05 tristanheilman

+1 for needing this - it will cause the whole library to break shortly

HannahCarney avatar May 28 '25 10:05 HannahCarney

same here...

crbcchris avatar Jun 27 '25 08:06 crbcchris