-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为什么装饰器不能用于函数? #98
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
装饰器只能用于类和类的方法,不能用于函数,因为存在函数提升。
原因:函数提升
解决方法:高阶函数HOF (HOC是高阶组件)
https://www.bookstack.cn/read/es6-3rd/spilt.3.docs-decorator.md
The text was updated successfully, but these errors were encountered: