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

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

点击查看代码
如果您的组件具有状态( state )或生命周期方法,请使用 Class 组件。否则,使用功能组件
posted @ 2022-11-12 15:01  Cherishe  阅读(39)  评论(0)    收藏  举报