Fix deprecated defaultProps error warning
- upgraded to work with react native 0.75.5
- tested locally with react native 0.75.5
- upgraded to typescript v5
- fixed linting error
Checks
- [x] I have read the contribution guidelines regarding Pull Requests here: https://git.io/JJ0Pg
Description
Below is a public repository that provides a simple test on a barebones React Native 0.75.5 project. v1.0.0 shows the error that this issue describes. v2.0.0 shows the provided patch and passing tests.
https://github.com/tristanheilman/react-native-render-html-684-test/releases
NOTE: There was one item that I didn't spend time figuring out and that was the website portion of this repository. I was getting errors with the rdocusaurus-plugin-sass repository due it using a git branch checkout. I was unable to run yarn install until providing a valid repository version.
Fixes issue #684
Any updates on this?
Why no updates on this? Any patch or suggestion to do if the update is not coming soon?
BUMP
+1 bump
Why no updates on this? Any patch or suggestion to do if the update is not coming soon?
A patch file is provided in the test repository that I shared. It can be found at this link: https://github.com/tristanheilman/react-native-render-html-684-test/blob/main/.yarn/patches/react-native-render-html-npm-6.3.4-35624feabf.patch
I'm unsure if yarn will allow you to straight copy over the patch file into your .yarn/patches folder. You may need to follow the below steps to patch from scratch.
To patch the library temporarily, you can follow the below steps:
- Clone the https://github.com/tristanheilman/react-native-render-html-684-test repository
- Run
yarn install
- You will utilize the node_modules/react-native-render-html folder later
- Install the react-native-render-html library in your main project using yarn
- Run
yarn patch react-native-render-html
➤ YN0000: Package react-native-render-html@npm:6.3.4 got extracted with success!
➤ YN0000: You can now edit the following folder: /private/var/folders/_q/5t99hgx90cg4_4hjs5fg0gsr0000gn/T/xfs-682b0fea/user
➤ YN0000: Once you are done run yarn patch-commit -s /private/var/folders/_q/5t99hgx90cg4_4hjs5fg0gsr0000gn/T/xfs-682b0fea/user and Yarn will store a patchfile based on your changes.
➤ YN0000: Done in 0s 121ms
- Navigate to the folder that yarn has created to edit the contents of the library
- Copy over the contents of the
node_modules/react-native-render-htmlproject from the 684-test repository into the yarn private folder and replace everything that is a duplicate - Run
yarn patch-commit -s {folderName}
The patch file should be created and stored in your .yarn/patches folder. You can compare it to the patch file created in the 684-test repository to confirm.
Any plans to merge this soon??? This error is getting annoying.
When will this fix be merged?
This is now a P0 since it become an error on Expo 52 (React Native 0.76.* and Android sdk 34 target) and Google policies requires apps to be update to Android sdk 35 till August 31th.
Hey,
for anyone who don't want to go through all steps @tristanheilman mentions.
This is his patch file you can put directly in /patches folder and just use patch-package.
react-native-render-html+6.3.4.patch
Hey, if patch from @palicko doesn't work, please try mine: react-native-render-html+6.3.4.patch
@olegmilan Thanks, the patch worked perfectly
Hey, for whom patch form @palicko doesn't work, please try mine: react-native-render-html+6.3.4.patch
Seems to work well for me RN 0.79+, Thanks
+1
thank you for the patch, it worked.
but we need this as default. any release plans?
Hey, for whom patch form @palicko doesn't work, please try mine: react-native-render-html+6.3.4.patch
This worked well for me.
However I was still getting some other warnings like :
"Warning: Failed prop type: The prop ignoredStyles is marked as required in TRenderEngineProvider, but its value is undefined.",
"Warning: Failed prop type: The prop customHTMLElementModels is marked as required in TRenderEngineProvider, but its value is undefined.",
"Warning: Failed prop type: The prop emSize is marked as required in TRenderEngineProvider, but its value is undefined.",
If you get these warnings as well, just try passing these props explicitly into your <RenderHTML />:
------
import RenderHTML, { defaultSystemFonts } from 'react-native-render-html';
<RenderHTML
customHTMLElementModels={{}}
ignoredStyles={[]}
emSize={16}
systemFonts={[...defaultSystemFonts]}
/>
------
+1 can we please merge this