Skip to content

WebView doesn't load local html file correctly #24251

Closed
@WebMobi59

Description

@WebMobi59

🐛 Bug Report

I am using webview to load local html file which shows the variety of tiles on google maps.
it works on native project, but two tiles doesn't load in react native project with same html file.

React Native screenshot.

MqNYQ

Native screenshot.

gDW3M

Expected Behavior

Need to show all tiles correctly like as native.

Code Example

Here is codechip for webview.

<WebView
          originWhitelist={['*']}
          onLoad={this.onLoad}
          source={Platform.OS === 'android' ? { uri: 'file:///android_asset/index.html' } : {uri: './index.html'}}
          dataDetectorTypes={'none'}
          ref='webview'
          onMessage={e => this.onMessage(JSON.parse(e.nativeEvent.data))}
          onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}
          onNavigationStateChange={this.onShouldStartLoadWithRequest}
          injectedJavaScript={patchPostMessageJsCode}
          useWebKit={true}
          />

I am not sure why this file doesn't work on react native.
Any help are appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugComponent: WebViewRelated to the WebView component.Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions