From 30ee548c01b731ecf6cb58e84aff2e4584484bdd Mon Sep 17 00:00:00 2001 From: Outvi V Date: Mon, 2 Nov 2020 00:13:22 +0800 Subject: [PATCH] Add notes to stress call-during-initialisation --- .../15-context/01-context-api/text.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/site/content/tutorial/15-context/01-context-api/text.md b/site/content/tutorial/15-context/01-context-api/text.md index 96a716dfb0..acc27c04f3 100644 --- a/site/content/tutorial/15-context/01-context-api/text.md +++ b/site/content/tutorial/15-context/01-context-api/text.md @@ -54,3 +54,25 @@ In fact, you might use the two together. Since context is not reactive, values t ```js const { these, are, stores } = getContext(...); ``` + +## `getContext()` must be called during component initialisation + +You may find this feature useful. However, remember to call `getContext()` during component initialisation! This means you can only use it directly in the `