react-native-webview-crosswalk icon indicating copy to clipboard operation
react-native-webview-crosswalk copied to clipboard

Cannot read property 'PureRenderMixin' of undefined

Open tarun29061990 opened this issue 8 years ago • 8 comments

After installing App crashes with the following error at line no 7 of index.android.js

"react": "16.0.0-alpha.6", "react-native": "0.44.0", "react-native-webview-crosswalk": "^0.5.0"

tarun29061990 avatar May 11 '17 20:05 tarun29061990

Hi, thanks for the report!

This is because React 0.16 is not supported yet. PureRenderMixin has been moved to react-addons-pure-render-mixin in React 0.16.

I haven't gotten around to updating the project, but in general, it isn't kept up to date for alpha or release candidate builds of React or React Native.

jordaaash avatar May 11 '17 21:05 jordaaash

Can you suggest a workaround?

I have added var PureRenderMixin = require('react-addons-pure-render-mixin'); in index.android.js of react-native-webview-crosswalk and in my js file invoking webview like this

<View style={{flex:1, height:Dimensions.get('window').height-10}}>
        <CrosswalkWebView
            style={styles.webView}
            url={this.state.url}
          />
        </View>

But my app crashes, please help.

tarun29061990 avatar May 12 '17 03:05 tarun29061990

For now, you'd have to use React 0.15.x, or modify this library to work with React 0.16.

This library isn't compatible with React 0.16 yet, which is still alpha/pre-release status at this time.

However, I'll leave this issue open, as it's relevant to updating the library to work with React 0.16.

jordaaash avatar May 16 '17 19:05 jordaaash

react-native 43 and 44 depend on react 16, so we seem to be stuck with that decision. Updating the library to react 16 is necessary to support the latest released versions of react-native. Encountered this today and the app hard crashes. Would love to see a resolution or workaround. Thanks!

lucasgray avatar May 20 '17 16:05 lucasgray

Hi there,due to the upgrade of react native the main index.android.js file use different type.Instead of add mixin to component we should create component inherited from React.PureComponent

Demo Gist Here - index.android.js

Obooman avatar Jun 09 '17 04:06 Obooman

https://github.com/punksta/react-native-webview-crosswalk/tree/react-native-0.45 you can use my fork with last react-native. It also has upgraded crosswalk.

punksta avatar Jun 11 '17 09:06 punksta

same issue

m860 avatar Jul 05 '17 02:07 m860

+1

RafaelHovhannisyan avatar Apr 16 '18 15:04 RafaelHovhannisyan