如何重写反应组件生命周期方法

问题描述 投票:0回答:1

我想重写反应组件的生命周期(如shouldComponentUpdate),必要时调用默认的。我想首先是这样的:

shouldComponentUpdate(nextProps, nextState) {
    return super.shouldComponentUpdate(nextProps, nextState);
}

但是,这是行不通的。我在想什么?

reactjs
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.