首页 > 其他分享 >什么时候在功能组件(ClassComponent)上使用类组件 (FunctionalComponent)?(必会)

什么时候在功能组件(ClassComponent)上使用类组件 (FunctionalComponent)?(必会)

时间:2022-11-12 15:12:41浏览次数:39  
标签:功能 必会 FunctionalComponent ClassComponent 使用 组件

什么时候在功能组件(ClassComponent)上使用类组件 (FunctionalComponent)?(必会)

点击查看代码
如果您的组件具有状态( state )或生命周期方法,请使用 Class 组件。否则,使用功能组件

标签:功能,必会,FunctionalComponent,ClassComponent,使用,组件
From: https://www.cnblogs.com/strundent/p/16883806.html

相关文章