Where To Use React Hooks

I'm sort of used to React hooks now. I'm not sure how I feel about them. Sometimes good, sometimes not so confident. But I like them enough to essentially not use class components anymore.

One thing I keep wondering about is where to use them. They seem like they'd make a easy shortcut to avoid container components. Often I end up passing props from hooks to functional components anyway. So maybe that would be best.

On the other hand, you're then on the, hah, hook, for carrying the effects and state it uses indefinitely. It also makes unit testing clumsier since it often requires a mock somewhere, which is a bit tedious.

One idea while writing this – Implement one module with two components. One is the core visual/functional component and the other sets up the hook and other effects.

export const Comp = props => ...

const ConnectedComp = () => {
  const x = useSomething() 
  return <Comp x={x} />

export default ConnectedComp;

Then you can clarify the unit tests, but also not have to do as much prop passing later on. I sorta feel like this is higher order components in a way, which don't seem as common anymore.

Maybe I should stop worrying and use hooks where I need them instead.