react native webview load from device local file system

后端 未结 5 1176
萌比男神i
萌比男神i 2020-12-07 21:08

I\'m trying to load .html, .js, .css files from device\'s local file system into React Native WebView component. I was able to get the

5条回答
  •  清歌不尽
    2020-12-07 22:09

    You may have to wrap your own Native Module to do this. React Native's WebView uses UIWebView, for info on loading a local file take a look here: https://gist.github.com/amster/9160860

    However it is recommended you use WKWebView, you can wrap one yourself relatively easily. There is currently a repo that is WIP: https://github.com/qrush/react-native-wkwebview

    Accomplishing loading local resources using WKWebView can be found in this answer: https://stackoverflow.com/a/28676439/398136

提交回复
热议问题