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

React 0.74 - Update defaultProps to JavaScript default parameters.

Open nd-gorm opened this issue 1 year ago • 72 comments
trafficstars

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

Hi it seems most components are setup to use TS defaultProp, which will be removed from function components. I suppose this future error is present in all components using defaultProps.

React Native Information

`Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.`

`MemoizedTNodeRenderer: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.`

RNRH Version

6.3.4

Tested Platforms

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

Reproduction Platforms

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

Minimal, Reproducible Example

Run in a React Native project >= 0.74

Additional Notes

No response

nd-gorm avatar May 15 '24 07:05 nd-gorm

same issue as @nd-gorm

Simba-Mupfunya avatar May 15 '24 11:05 Simba-Mupfunya

same issue as @nd-gorm .-)

QuentinOber avatar May 15 '24 19:05 QuentinOber

Same, after upgrading to react native 0.74

bruce-mec avatar May 16 '24 13:05 bruce-mec

Same issue here. But the question is: is this project still alive?

ivanoikon avatar May 17 '24 06:05 ivanoikon

I see attempts to fix this (https://github.com/meliorence/react-native-render-html/commit/f0c7e34571f613fc70d183955661cd23df420238). But they failed the test. There are suspicions that the project is really abandoned :(

olegkvasov avatar May 19 '24 07:05 olegkvasov

I reached out with an offer to sponsor and have not heard back, so I have similar concerns. Perhaps time for a fork? Or perhaps @meliorence can add a maintainer.

djMax avatar May 19 '24 21:05 djMax

same here, will show the warning as below

ERROR  Warning: TNodeChildrenRenderer: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
ERROR  Warning: MemoizedTNodeRenderer: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.
ERROR  Warning: TRenderEngineProvider: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

Version:

  • react-native-render-html: 6.3.4
  • react native: 0.74.1
  • react: 18.2.0

ba361006 avatar May 21 '24 08:05 ba361006

@djMax and @ba361006 Eventually, I took this package and made it for myself inside my project

https://www.npmjs.com/package/htmlparser2-without-node-native

olegkvasov avatar May 21 '24 17:05 olegkvasov

But this doesn't do any of the translation to React components, no? That's the main magic bit of this module, IMHO.

djMax avatar May 21 '24 18:05 djMax

No, I just needed to display the users html in the View

olegkvasov avatar May 21 '24 18:05 olegkvasov

The CI step that failed when merging a fix in #658 was a linting step. Lint errors were fixed in #660, in which regarding the potential for a release the maintainer said, "I cannot promise anything, but will consider releasing when I find some time off." So, a fix may be released, but not on any definite timeline.

chriszs avatar May 28 '24 02:05 chriszs

Also looking forward to the fix release

linusrush avatar Jun 04 '24 12:06 linusrush

same issue as @nd-gorm

bytemtek avatar Jun 13 '24 11:06 bytemtek

Same issue as @nd-gorm

IvanMijic0 avatar Jun 13 '24 17:06 IvanMijic0

same issue as @nd-gorm

Cube321 avatar Jun 13 '24 19:06 Cube321

Is there any solution ?

bytemtek avatar Jun 14 '24 12:06 bytemtek

I solved switching to this library while waiting for a fix react-native-html-text-view.

ivanoikon avatar Jun 14 '24 12:06 ivanoikon

I solved switching to this library while waiting for a fix react-native-html-text-view.

Thank you so much.

bytemtek avatar Jun 14 '24 14:06 bytemtek

I switched to react-native-htmlview and it's working fine so far; smooth transation.

QuentinOber avatar Jun 14 '24 16:06 QuentinOber

@jsamr any update?

tmeduho avatar Jun 17 '24 18:06 tmeduho

@skb1129 was the work done but not yet released?

https://github.com/meliorence/react-native-render-html/commit/f0c7e34571f613fc70d183955661cd23df420238

AronBe avatar Jun 18 '24 11:06 AronBe

@AronBe correct, see https://github.com/meliorence/react-native-render-html/pull/660

tmeduho avatar Jun 24 '24 14:06 tmeduho

same issue

ycldz avatar Jul 04 '24 13:07 ycldz

same issue for me, try switch to react-native-htmlview

edritech93 avatar Jul 10 '24 04:07 edritech93

@tmeduho So, do we have to wait now? or can we use this GitHub branch as a package on my project? Is there any workaround?

vinz-mehra avatar Jul 11 '24 21:07 vinz-mehra

Unfortunately, react-native-htmlview is missing a lot of features that this library has, which makes it a less than ideal replacement. At least, in my experience.

Hoping for a release soon!

TheRealMikeD avatar Jul 11 '24 23:07 TheRealMikeD

if someone needs, here is patch-package fixing issue

react-native-render-html+6.3.4.patch

awlodarczyk avatar Jul 17 '24 07:07 awlodarczyk

if someone needs, here is patch-package fixing issue

react-native-render-html+6.3.4.patch

How can be used?

ivanoikon avatar Jul 17 '24 07:07 ivanoikon

Hi Adam, amazing, thanks so much! :) However, I also struggle a bit how to properly implement it to the project. Would it be possible to give us few words of guidance? Thank so much! Jakub

Cube321 avatar Jul 17 '24 07:07 Cube321

@ivanoikon @Cube321 patch-package is an npm package that allows to make modifications in npm dependencies. see in the provided link.

PadovaY avatar Jul 17 '24 07:07 PadovaY