我听说严格模式通过引发生命周期方法删除警告来帮助以最佳实践方式编写React代码。
我从https://medium.com/@baphemot/whats-new-in-react-16-3-d2c9b7b6193b阅读
我的理解正确吗?严格模式有效吗?它仅适用于不安全的生命周期方法吗?如果不能,我可以在功能组件中使用此功能吗?
import { StrictMode} from “react”;
class Test extends Component{
render(
<StrictMode>
//Some other child component which has all lifecycle methods implemented in it
</StrictMode>
);
}
Run Code Online (Sandbox Code Playgroud)