import React, { Component } from 'react'

export default class NeedRender extends Component {

    constructor (props) {
        super(props)
    }

    shouldComponentUpdate(nextProps, nextState){
        if(this.props.data instanceof Array){
            if(this.props.data.length == nextProps.data.length){
                return false;
            }
        }
        else if(this.props.data == nextProps.data){
            return false;
        } 
        return true;
    }
    render() {
        const {children} = this.props;
        return (
            <div>
                {children}
            </div>
        )
    }
}

