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 <justin.m.starry@gmail.com>
This commit is contained in:
codec-abc 2020-05-26 18:59:36 +02:00 committed by Justin Starry
parent baf14cf083
commit c25d834fce

View File

@ -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" %}