Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Can't add property onScroll, object is not extensible #1

Open
jeromecovington opened this issue Nov 10, 2015 · 5 comments
Open

Comments

@jeromecovington
Copy link

This is the stack trace I am getting right now, after swapping LazyloadView for ListView:

Error: Can't add property onScroll, object is not extensible
 stack: 
  React.createClass._merge                                                     index.ios.bundle?…:86404
  React.createClass.render                                                     index.ios.bundle?…:86539
  ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext  index.ios.bundle?…:8961
  ReactCompositeComponentMixin._renderValidatedComponent                       index.ios.bundle?…:8983
  wrapper [as _renderValidatedComponent]                                       index.ios.bundle?…:5850
  ReactCompositeComponentMixin.mountComponent                                  index.ios.bundle?…:8480
  wrapper [as mountComponent]                                                  index.ios.bundle?…:5850
  Object.ReactReconciler.mountComponent                                        index.ios.bundle?…:6688
  ReactMultiChild.Mixin.mountChildren                                          index.ios.bundle?…:23365
  ReactNativeBaseComponent.Mixin.initializeChildren                            index.ios.bundle?…:19782
  ReactNativeBaseComponent.Mixin.mountComponent                                index.ios.bundle?…:19906
  Object.ReactReconciler.mountComponent                                        index.ios.bundle?…:6688
  ReactCompositeComponentMixin.mountComponent                                  index.ios.bundle?…:8486
  wrapper [as mountComponent]                                                  index.ios.bundle?…:5850
  Object.ReactReconciler.mountComponent                                        index.ios.bundle?…:6688
  ReactCompositeComponentMixin.mountComponent                                  index.ios.bundle?…:8486
 URL: undefined
 line: undefined
 message: Can't add property onScroll, object is not extensible

Here is how I am calling the view:

'use strict';

var React = require('react-native');
var {Image, View} = React;
var LazyloadView = require('react-native-scrollview-lazyload');

var ExampleComponent = React.createClass({
  // Stuff for getting the slide data, etc.
  // Not necessarily relevant for the lazyload issue. 

 _renderSlide: function (slide) {
    return (
      <View>
        <Image 
          resizeMode={'contain'}
          lazyloadSrc={{uri: slide.uri}}/>
      </View>
    );
  },

  render: function () {
    return (
      <View>
        <LazyloadView
          dataSource={this.state.dataSource}
          renderRow={this._renderSlide}/>
      </View>
    );
  }
});

module.exports = ExampleComponent;
@jeromecovington
Copy link
Author

@schmarjames
Copy link

How did you go about solving that issue within the render function on line 153. I'm having a problem with that same _merge function. I received an error saying "Attempted to assign to readonly property.

@Geogon
Copy link

Geogon commented Dec 26, 2015

+1

@IskenHuang
Copy link
Owner

@jeromecovington @schmarjames Could you provide your react-native version?

@jeromecovington
Copy link
Author

I noticed this problem on react-native v0.14.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants