Early return
Also written: return early
Using `if` with `return` at the start of a component to output something different, such as "Your cart is empty.", so the rest of the function doesn't run. Hooks must still be called before any early return.
Also written: return early
Using `if` with `return` at the start of a component to output something different, such as "Your cart is empty.", so the rest of the function doesn't run. Hooks must still be called before any early return.