I’ve successfully used the following pattern to load an html file into a webview in Expo on Android and iOS in the new react-native-community-webview package
// get the html file
const requiredAsset = require('./dist/index.html');
// load the file at componentDidMount
componentDidMount = async () => {
try {
const asset = await AssetUtils.resolveAsync(requiredAsset);
// console.log({ asset });
this.setState({ asset });
} catch (error) {
console.log({ error });
}
};
// in render() create a conditional so that the WebView isn't rendered until the asset is available in state
// once the asset is available you can use it like this:
source={{ uri: this.state.asset.uri }}