From fe624708b69a4c2c20d251c680d029664a30d5eb Mon Sep 17 00:00:00 2001 From: Andrii Bodnar Date: Fri, 27 Dec 2024 16:20:43 +0200 Subject: [PATCH] docs: better communicate macro usage restrictions (#2139) --- website/docs/tutorials/javascript.md | 4 ++++ website/docs/tutorials/react.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/website/docs/tutorials/javascript.md b/website/docs/tutorials/javascript.md index 7e482320e..81b9c01c0 100644 --- a/website/docs/tutorials/javascript.md +++ b/website/docs/tutorials/javascript.md @@ -84,6 +84,10 @@ select(gender, { }); ``` +:::caution +All Core Macros cannot be used at the module level. They must be used within a component or function. See the [Macros](/ref/macro#using-macros) documentation for more information. +::: + ## See Also - [Message Extraction Guide](/guides/message-extraction) diff --git a/website/docs/tutorials/react.md b/website/docs/tutorials/react.md index 75fecdeef..f14a32604 100644 --- a/website/docs/tutorials/react.md +++ b/website/docs/tutorials/react.md @@ -645,6 +645,10 @@ export default function ImageWithCaption() { ::: +:::caution +All Core Macros cannot be used at the module level. They must be used within a component or function. See the [Macros](/ref/macro#using-macros) documentation for more information. +::: + ## Review After all modifications, the final i18n-ready component looks like this: