From fefa4e6ed6f2112fb9f7266cea9739be00c7dd18 Mon Sep 17 00:00:00 2001 From: Antony Jones Date: Tue, 23 Jun 2020 15:53:49 +0100 Subject: [PATCH] docs: clarify onMount with non-synchronous handlers (#5053) --- site/content/docs/03-run-time.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/site/content/docs/03-run-time.md b/site/content/docs/03-run-time.md index 460c393e7e..42a99bea70 100644 --- a/site/content/docs/03-run-time.md +++ b/site/content/docs/03-run-time.md @@ -50,6 +50,8 @@ If a function is returned from `onMount`, it will be called when the component i ``` +> This behaviour will only work when the function passed to `onMount` *synchronously* returns a value. `async` functions always return a `Promise`, and as such cannot *synchronously* return a function. + #### `beforeUpdate` ```js