From 47f508fd2d3e42759cec93eacc569fe2f05ce95a Mon Sep 17 00:00:00 2001 From: elliotwaite <1767836+elliotwaite@users.noreply.github.com> Date: Wed, 24 May 2023 15:30:39 -0700 Subject: [PATCH] Clarify hooks rules to mention early returns --- docs/guide/src/en/interactivity/hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/src/en/interactivity/hooks.md b/docs/guide/src/en/interactivity/hooks.md index 3539e588..083f04b4 100644 --- a/docs/guide/src/en/interactivity/hooks.md +++ b/docs/guide/src/en/interactivity/hooks.md @@ -44,7 +44,7 @@ This is only possible because the two hooks are always called in the same order, 1. Hooks may be only used in components or other hooks (we'll get to that later) 2. On every call to the component function - 1. The same hooks must be called + 1. The same hooks must be called (except in the case of early returns, as explained later in the [Error Handling chapter](../best_practices/error_handling.md)) 2. In the same order 3. Hooks name's should start with `use_` so you don't accidentally confuse them with regular functions