Allow hooks in the expression of a match statement and if statement (#2902)

* Allow hooks in the expression of a match statement and if statement

* Don't allow hooks in spawn and detect hooks in initialization closures

* Point to DX check when hooks are called conditionally
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-09-07 13:35:15 -05:00
1 parent 7bb53fe835
commit c11f2ed3cd
4 files changed
+232 -7

No files matched your search

+2
View File
@@ -424,6 +424,8 @@ impl Scope {
You likely used the hook in a conditional. Hooks rely on consistent ordering between renders.
Functions prefixed with "use" should never be called conditionally.
Help: Run `dx check` to look for check for some common hook errors.
"#,
)
}