From c25d834fcea79f0cf250c9f15843f2c076fd0da9 Mon Sep 17 00:00:00 2001 From: codec-abc Date: Tue, 26 May 2020 18:59:36 +0200 Subject: [PATCH] Add a note telling how to bypass the recursion limit of the html! macro. (#94) * Add a note telling how to bypass the recursion limit of the html! macro. * Update src/concepts/html/README.md Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com> * Update src/concepts/html/README.md Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com> Co-authored-by: Justin Starry --- docs/concepts/html/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/concepts/html/README.md b/docs/concepts/html/README.md index 74f8584b5..e3c683d5e 100644 --- a/docs/concepts/html/README.md +++ b/docs/concepts/html/README.md @@ -11,6 +11,9 @@ The `html!` macro allows you to write HTML and SVG code declaratively. It is sim 1. The `html!` macro only accepts one root html node \(you can counteract this by [using fragments or iterators](lists.md)\) 2. An empty `html! {}` invocation is valid and will not render anything 3. Literals must always be quoted and wrapped in braces: `html! { "Hello, World" }` +{% hint style="info" %} +The `html!` macro can reach easily the default recursion limit of the compiler. It is advised to bump its value if you encouter compilation errors. Use an attribute like `#![recursion_limit="1024"]` to bypass the problem. See the [official documentation](https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute) and [this Stack Overflow question](https://stackoverflow.com/questions/27454761/what-is-a-crate-attribute-and-where-do-i-add-it) for details. +{% endhint %} {% page-ref page="lists.md" %} @@ -19,4 +22,3 @@ The `html!` macro allows you to write HTML and SVG code declaratively. It is sim {% page-ref page="literals-and-expressions.md" %} {% page-ref page="components.md" %} -