react中shouldComponentUpdate的使用问题

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

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


export default BottomNavMU;

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

阅读 3.4k
1 个回答

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

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题