react-native-rich-editor: Crash on android
App crash when i navigate to android from flatlist, i tried androidHardwareAccelerationDisabled but not work, please help
Version detail
"react-native-webview": "^11.17.1",
"react-native-pell-rich-editor": "^1.8.8",
"react-native": "^0.67.1",
The code
<RichEditor
androidHardwareAccelerationDisabled
editorInitializedCallback={() => {
richText?.current?.setFontName("Montserrat");
}}
ref={richText}
editorStyle={{
cssText: fontEditor,
contentCSSText: editorCss,
// backgroundColor: color.backgroundGrey,
}}
onChange={(descriptionText) => {
console.log("descriptionText:", descriptionText);
}}
/>
Behavior
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 5
- Comments: 24 (1 by maintainers)
Like @KazakovVS suggests, you can pass
androidLayerTypeprop withsoftwarevalue to underlying web view:androidHardwareAccelerationDisabledis deprecated according to react-native-webview documentation, so there is no need to use itInstead of switching off the hardware acceleration globally, just passed 2 additional params to the component:
Hey @sameer0075, until an new version is released, here is a workaround, check how
patch-packageworks. https://www.npmjs.com/package/patch-packageAfter you have installed your packages with npm or yarn, check for
react-native-pell-rich-editorlibrary folder, installed in node_modules folder, path: ./node_modules/react-native-pell-rich-editor/src/ . After check for the fileRichEditor.json line 270, you will have thedataDetectorTypes={'none'}attribute. Just comment it out and use the patch-package to create a patch, commit your new package.json and createdpatchfolder to your GIT repo and next time you will install your packages the patch will automatically be applied.This worked in my case, as I am using Expo aswell.
Everything else
androidHardwareAccelerationDisabled,androidLayerType="software"orAdd android:hardwareAccelerated="false" in AndroidManifest.xmldid not work for me.Now works great both on iOS and Android.
Add android:hardwareAccelerated=“false” in AndroidManifest.xml
it worked for me!
I had the same issue, looking into sentry I have the following stack trace
There is a known hack adding
opacity: 0.99to the style of the WebView. I have tried it and it works.This one worked for me
I recently started experiencing the same issue as well
Yhh it worked for me as well.
@mmaghiar thanks a lot, It worked 😃
@mmaghiar thanks alot, it worked for me thanks for saving me
Thank You So Much @davidwico well worked On android 12
I am also facing same issue