超出最大调用堆栈大小反应原生

时间:2017-09-23 16:05:42

标签: ios reactjs react-native

亲爱的朋友们,我在简单的代码中遇到问题 当我运行代码i`给出这个错误。向我本人道歉,反应原生:)

 import React, { Component } from 'react';

 import {
   ListView,
   View
    } from 'react-native';

 import MyPresentationalComponent1 from './MyPresentationalComponent1'

 export default class MyContainerComponent extends Component {
     constructor(props) {
     super(props);
     const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== 
          r2});
     this.state = {
         dataSource: ds.cloneWithRows([
        'Item1', 'Item2', 'Item3', 'Item4', 'Item5', 'Item6', 'Item7', 
                     'Item8',
           'Item9', 'Item10'
             ])
          };
         }
 render() {
    return (
     <View>
       <MyPresentationalComponent1 dataSource = {this.state.dataSource}/>
     </View>
     );
    }
  }`

0 个答案:

没有答案