-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
精读《@types/react 值得注意的 TS 技巧》 #245
Comments
@types/react 属于有精华也有糟粕吧,单说 TS 技巧确实值得学习 |
一定有糟粕,但整体看下来有很多值得学习的地方。 |
请教下糟粕是指哪部分~ |
我也是一直观察 @types/react 的 issue 和 pr。 我说的糟粕主要是说和 react 的实现上的 gap,而且这个 gap 不小。
我一时间想到的是这些,这都是很具体的,很 corner case 的问题。 TypeScript 像是一个很标准的正方形,它却要 100% 适应 JavaScript 这样很容易奇形怪状的具体实现。这是其中的困难之处。我不认为其中有 @type/react 的实现太差,或者是 TypeScript 用的不好的问题。 它在 TypeScript 的实现上是非常优秀的,我也是从中学到了很多。 |
受教了!谢谢,看来里面的 TS 写法还是值得学习的。 |
@types/react 为什么对Component用了interface又用了class,只用interface表示不行吗?@ascoders |
持续寻找高质量前端周刊真不容易,前端周刊现在有大量新闻稿类的与深度万字入门文章类,都不太有营养,本周还是继续从官方资源挖掘信息吧,读一读 react 的类型定义文件,学习与分享一些 TS 技巧。
精读《@types react 值得注意的 TS 技巧》
The text was updated successfully, but these errors were encountered: