4 ms·
But there's something to be said about needing a lint rule for the API to be safely used.
by snek 8y ago
But there's something to be said about needing a lint rule for the API to be safely used.
- korm 8y agoTo play devil's advocate, this has always been the case with React. Newbies always mutate props or use setState incorrectly or in the wrong lifecycle methods. We've relied on linting to solve this for a long time now.
- blankaccount 8y agoThe nice thing about functional programming is that you can reason about execution and write lint rules to fix pitfalls that you can't detect with imperative programming.
- danabramov 8y agoI think the article touches on that point. Specifically, the lint rule points out a problem that a class implementation would also likely have. Except that you can’t easily lint the class implementation in a similar way. The lint rule is not to appease React. It’s to show you where a component doesn’t handle updates. This is already very common with classes but those issues tend to stay unnoticed.