Set androidLayerType on WebView to prevent crash on Android 12
Issue
On Android 12 (I didn't test on Android 9), React Native Plotly always crashes with null pointer dereference issue (see crash log).
The same issue also occurred here (on Android 9): https://github.com/react-native-webview/react-native-webview/issues/1069
Solution
The issue can be solved by setting androidHardwareAccelerationDisabled to true. However, that prop has been deprecated (see this) and we should use androidLayerType instead.
The above solution has been tested on Android phone as well as emulator.
I don't have any issues using this library on Android 12. If you need to set the androidLayerType for you use case, I would be ok if you made a prop for the Plotly component that is then passed into the webview, but I don't want to change the default.
Sorry for the slow response. Yeah, I think it's a good idea. I will modify it on the weekend. It has something to do with the data that we pass to the WebView. So, for certain data, it causes crash. Thank you