在React的官方文档中提到-Ifyou’refamiliarwithReactclasslifecyclemethods,youcanthinkofuseEffectHookascomponentDidMount,componentDidUpdate,andcomponentWillUnmountcombined.我的问题是-我们如何在Hook中使用componentWillMount()生命周期方法? 最佳答案 您不能在Hook中使用任何现有的生命周期方法(componentDidMount、componentDidUpdate