Thinking in React Hooks
I have not been a fan of hooks thus far, but these are some intriguing examples. Especially the useMemo ones.<p>My complaints about hooks are that with hooks we lose useful tools in our react toolkit: class methods, separate componentDidMount&#x2F;componentDidUpdate lifecycle events, shouldComponentUpdate, PureComponent, etc.<p>And my biggest complaint is that we&#x27;re losing simplicity. React spread like wildfire when it first came out because it was so beautifully simple: a class, with something called `props`, and this.state and this.setState(). That&#x27;s it. You can build SO MUCH with just that.<p>To me, with hooks, React&#x27;s simplicity is being replaced by cloudiness. There&#x27;s so much &quot;magic&quot; now. The order of hooks in the code is the most important thing for a hook component to work right. New linter rules had to be built to remind people where hooks need to be written.<p>I do appreciate the work that&#x27;s been put into hooks. And like any other open source project, I&#x27;m incredibly grateful to the authors and maintainers. I guess I just wonder if anyone shares the same sentiments as mine, because it seems like the only thing I read about this topic is that classes suck, class components are full of pitfalls, etc.