-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
renderFunction 定义在 render 方法之后,或为匿名函数,会被识别成 renderProps #3966
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
Duplicate of #3914 |
下个版本 ESLint 会规范你的组件生命周期顺序 |
@yuche 这不算是解决方法吧?如果我用 typescript ,更倾向于把方法都定义为私有方法,而且匿名函数也是需要的 |
你私有与否不影响 ESLint 的运行 |
因为 private 方法从风格上来说,应该放在public 方法后面 |
yuche
added a commit
that referenced
this issue
Jul 26, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
renderFunction
如果定义为匿名函数,或者定义在了 render 方法之后,会被识别成renderProps
, import 无用的 SuperClass复现步骤
在 render 方法之后定义
renderFunction
,或者将 render 方法定义为匿名函数期望行为
正确识别 render 函数
报错信息
系统信息
补充信息
renderFunction
如果定义为匿名函数,或者定义在了 render 方法之后,self.methods
里就不会包含这个 render 函数,因此会被认为是renderProps
,从而会把SuperClass
import 进来。The text was updated successfully, but these errors were encountered: