mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* 0.20 Changelog * Improve changelog generator * Add blog post * Add blog post * Apply suggestions from code review Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com> Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com> * update Changelog * update Cargo.toml * changelog gen compiles * website version 0.20 * add migration guides * prettier * i18n Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com> Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
23 lines
1.4 KiB
Plaintext
23 lines
1.4 KiB
Plaintext
---
|
|
title: Introduction
|
|
description: The procedural macro for generating HTML and SVG
|
|
slug: /concepts/html
|
|
---
|
|
|
|
`html!`マクロによって HTML と SVG のコードを宣言的に書くことができます。
|
|
JSX \(HTML のようなコードを JavaScript 内部に書くことができる JavaScript の拡張\) に似ています。
|
|
|
|
**重要な注意**
|
|
|
|
1. `html!`マクロはルートの HTML ノードのみ受け付けます \([フラグメントかイテレータを使う](./lists.mdx)ことでやり取りできます\)
|
|
2. 空の`html! {}`の呼び出しは可能ですが何もレンダリングしません
|
|
3. リテラルはクオーテーションがつけられ、ブレースで囲う必要があります: `html! { "Hello, World" }`
|
|
|
|
:::note
|
|
`html!`マクロはコンパイラのデフォルトの再帰の上限に簡単に達してしまいます。
|
|
もしコンパイラエラーに遭遇した場合はその値を押し出すといいかもしれません。
|
|
クレートのルート\(つまり、`lib.rs`か`main.rs`\)で`#![recursion_limit="1024"]`のような属性を使えば解決します。
|
|
|
|
詳しくは[公式ドキュメント](https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute)と[Stack Overflow の質問](https://stackoverflow.com/questions/27454761/what-is-a-crate-attribute-and-where-do-i-add-it)を見てみてください。
|
|
:::
|