IIRC there is an eslint rule you can configure for this sort of thing. I wonder if the same can be configured with standard.
I believe the target is that react hooks can’t be conditional called, like within an if else, or after a conditional return, like it was here