函数式组件的使用 #10996
cnpaladinhxy
started this conversation in
Ideas
函数式组件的使用
#10996
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
官网函数式组件文档 中提到,可以使用函数定义一个组件。但是事实上这个函数会被当做一个渲染函数来执行,每次dom更新都会重复执行它,这导致函数内部的变量无法维持状态。希望可以改为:返回一个函数,这个函数被作为渲染函数来处理。
Beta Was this translation helpful? Give feedback.
All reactions