I need to load html and js files from assets folder in the WebView. I have tried using :
<WebView source={{uri: "file:///android_asset/index.html"}} />
along with javaScriptEnabled={true}
. The html file is loaded but XMLHttpRequest stops working. I guess it's due to the 'file' protocol.
Is there any other way to access the files in assets folder without using file:///
? Or in that matter, any other solution to this problem.
Found the way. Used react-native-static-server to create a server and load html file.