From 817e98ee52411b18bfda74584aa3db7bf970fde8 Mon Sep 17 00:00:00 2001 From: David <39827040+Lootwig@users.noreply.github.com> Date: Wed, 17 May 2023 14:32:17 +0200 Subject: [PATCH] Update lifecycle `onMount` docs Clarify onDestroy behavior for async onMount callbacks --- site/content/tutorial/07-lifecycle/01-onmount/text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/tutorial/07-lifecycle/01-onmount/text.md b/site/content/tutorial/07-lifecycle/01-onmount/text.md index 6baa254e9f28..33998310d0b7 100644 --- a/site/content/tutorial/07-lifecycle/01-onmount/text.md +++ b/site/content/tutorial/07-lifecycle/01-onmount/text.md @@ -25,4 +25,4 @@ We'll add an `onMount` handler that loads some data over the network: Lifecycle functions must be called while the component is initialising so that the callback is bound to the component instance — not (say) in a `setTimeout`. -If the `onMount` callback returns a function, that function will be called when the component is destroyed. \ No newline at end of file +If the `onMount` callback returns a function synchronously, that function will be called when the component is destroyed. Note however that an `async` callback can't return a function, but only a `Promise` of a function, which will not be called automatically in `onDestroy`.