3 ms·
I agree that the lookup map thing looks like very bad advice. I can't see a reason why you'd do something like that. On topic, it has been my understanding tha
by efdee 6y ago
I agree that the lookup map thing looks like very bad advice. I can't see a reason why you'd do something like that.
On topic, it has been my understanding that the React team is moving away from classes for a number of reasons. Not just because it confuses people (although the pattern seems to create expectations that aren't met due to Javascript's weird 'this' behavior), but also because it doesn't have a good pattern for code reuse (as demonstrated by the lack of mixins that used to be popular in React's createClass syntax) and also because it seems to be a suboptimal pattern for compilers.
That said, I've moved on from class components to function components with hooks and I can't remember the last time I thought something would be easier to implement as a class component, even though it is still an option to do so. But that is, of course, anecdotal.