报错以及一些方法

 1. Requiring unknown module "593". if you are sure the module is threr,try restarting Metro Bundler

意思就是没有导入控件
2.出现undefined is not an object (evaluating 'this.props.navigator')
https://blog.csdn.net/m13215519957/article/details/65940297
3.Warning:Each child in an array or iterator should have a unique "key" prop 给 cell 添加一个标识

 

4.给数组里面的添加点击方法

    /** 定义一个数组 然后把数组输出数去 **/
    setView(){
        var itemArr = [];
        for (var i = 0; i < MiddleData.length; i++){
            var data = MiddleData[i];
            itemArr.push(
                
                    
                
            )
        }
        return itemArr;
    }

    changeChild(key){
        this.props.clickMiddenCell?this.props.clickMiddenCell(key):null
    }
  1. 导航栏的点击
    /** 设置导航栏 **/
    static navigationOptions = ({navigation,screenProps}) => ({
        headerRight:(
            
        )
    })
    componentDidMount(){
        this.props.navigation.setParams({
            clickHeaderViewCell:this.clickHeaderViewCell,
        })
    }
    clickHeaderViewCell(title){
        const { navigate } = this.props.navigation;
        navigate('YBXMoreContent',{headerTitle:title});
    }

    constructor(props) {
        super(props);
        this.clickCell=this.clickCell.bind(this);
        this.clickMiddenCell=this.clickMiddenCell.bind(this);
        this.clickHeaderViewCell=this.clickHeaderViewCell.bind(this);
    }
Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type `number` supplied to `CellRenderer`, expected `string`.

消除方法:keyExtractor={(item, index) => index.toString()}

7.WebStore的一些坑

    render() {
        return (
            
                
            
        );
    }
里面注释的一些代码尽然可以运行 = = 

传送门:
https://www.jianshu.com/p/98c8f2a970eb

你可能感兴趣的:(报错以及一些方法)