Skip to content

WebView JS Error: undefined is not an object (evaluating '_this.props') #9966

Description

@johnryan

Issue Description

I'm using QR code library that internally renders in a WebView (https://github.com/cssivision/react-native-qrcode/issues). When the webview renders it throws the error but does actually render the WebView behind the red box:

This issue began in 0.32.0 it seems with this change:

_onLoadingStart: function(event: Event) { ...

To:

_onLoadingError = (event: Event) => { ...

Steps to Reproduce / Code Snippets

Just rendering the QR Code view with this snippet (that is being presented with Navigator)

          <View>
                <WebView
                    automaticallyAdjustContentInsets={false}
                    contentInset={{top: 0, right: 0, bottom: 0, left: 0}}
                    source={{html: "TEST HTML"}}
                    opaque={false}
                    underlayColor={'transparent'}
                    javaScriptEnabled={true}
                    scrollEnabled={false}
                />
            </View>

Expected Results

There should be no error displayed

Additional Information

  • React Native version: 0.34.0-rc0 (but also every version back to 0.32.0)
  • Platform(s) (iOS, Android, or both?): Both
  • Operating System (macOS, Linux, or Windows?): macOS

Other notes: This seems to be happening in several other places

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions