Rules of hooks
Call hooks only at the top level of a component, before any `return`, never inside an `if`, loop or nested function. That way every render calls the same hooks in the same order.
Call hooks only at the top level of a component, before any `return`, never inside an `if`, loop or nested function. That way every render calls the same hooks in the same order.