Nothing is simpler than a function. Easier to write, debug, and test.
* Removed "pure" to make my main point clear.
* Removed "pure" to make my main point clear.
But my point was functions are simpler in all those scenarios, pure or not. Edited my comment to reflect that.
Sure, if you define a function called useWhatever that doesn't actually call any hooks, that might be a pure function. But the restrictions described in https://reactjs.org/docs/hooks-rules.html are not restrictions that pure functions have.