首页 > react中shouldComponentUpdate的使用问题

react中shouldComponentUpdate的使用问题

假如一个jsx文件内,使用的是这样的方式

const A = ({abc}) => {
    return (
        <div>{abc}</div>
    );
};


export default BottomNavMU;

shouldComponentUpdate这类的方法能在这种形式的写法内用吗? 还是只能在 component extend React.Component这种写法里用?


stateless component不支持lifecycle(包括shouldComponentUpdate)方法。

【热门文章】
【热门文章】