3 ms·
Example: https://imgur.com/oR3Nk8q https://imgur.com/oR3Nk8q This was generated by one line of code, simply applying the hoist-non-react-statics library as rec
by mediumdeviation 8y ago
Example: https://imgur.com/oR3Nk8q https://imgur.com/oR3Nk8q
This was generated by one line of code, simply applying the hoist-non-react-statics library as recommended by the official React docs https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over https://reactjs.org/docs/higher-order-components.html#static...
JavaScript in many cases can be too dynamic to be properly typed. I'd rather have it than not - it has saved my ass a good number of times - but let's not pretend TS/Flow is totally wonderful.
- Cthulhu_ 8y agoError messages like that are pretty bad, yeah. I'm still a fan of TS myself though, the challenge is that there's some less-well-designed JS libraries that are, like you said, too dynamic to be properly typed. It's bringing OOP back from having almost been forgotten, and with it, a reminder of proper library design and data types.
- WorldMaker 8y agoI've only recently started into React, but my impression is because many React teams use Flow or nothing at all, the Typescript types definitely lag behind releases. At some point I hope to sit down and start filing bugs/sending PRs to fix many of the React Typescript types I find, but in the meantime there are several React modules I've replaced the with just `declare module 'react-thing'` to jus any-type it and move on.
- noir_lord 8y agoLooks like a jetbrains IDE, I'm a massive fan of intellij and it's my goto programming environment but it's type error messages with typescript are terrible compared to vscode (enough that if I can't understand what the hell it's saying I'll boot vscode). It's about the one thing I can really ding intellij for at the moment.