Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

expo webview local html

/* Outside of return */
const { localUri } = Expo.Asset.fromModule(require('./pathToFile.html'));
/* On the webView */
source={
  Platform.OS === ‘android’
  ? {
    uri: localUri.includes('ExponentAsset')
      ? localUri
      : ‘file:///android_asset/’ + localUri.substr(9),
  }
  : require(‘./pathToFile.html’)
}
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #expo #webview #local #html
ADD COMMENT
Topic
Name
3+3 =