react-native-scrollview-lazyload icon indicating copy to clipboard operation
react-native-scrollview-lazyload copied to clipboard

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

Open jeromecovington opened this issue 10 years ago • 5 comments

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 avatar Nov 10 '15 21:11 jeromecovington

Issue is here? - https://github.com/IskenHuang/react-native-scrollview-lazyload/blob/master/index.js#L153-L158

jeromecovington avatar Nov 11 '15 16:11 jeromecovington

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.

schmarjames avatar Dec 13 '15 19:12 schmarjames

+1

Geogon avatar Dec 26 '15 10:12 Geogon

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

IskenHuang avatar Feb 24 '16 14:02 IskenHuang

I noticed this problem on react-native v0.14.2

jeromecovington avatar Feb 24 '16 15:02 jeromecovington