Search code examples
react-nativewebviewhardware-acceleration

Set LayerType for WebView in React Native


Web View causes issues with rendering until I do a touch action. So trying to disable hardware acceleration as webview.setLayerType(View.LAYER_TYPE_SOFTWARE, null); but there is no reference for this from react native side.

Have took a look at all possible props from react native web view.

Should I write a customWebView and override with nativeConfig or is there an easier alternative


Solution

  • Web View renders on priority indirectly when it is the only view returned in the component. It get lesser priority when its nested.

    <View>
       <Webview />
    <View>
    

    changed the above to the following

    <Webview />
    

    and it works like a charm