You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
html!(
<div>"First element"</div>
<div>"Illegal second element"</div>
)
you get
error: proc-macro derive panicked
--> src/views.rs:122:5
|
122 | / html!(
123 | | <div class="prices-table-title" id="products-cupcakes">"cupcakes"</div>
124 | | <div class="prices-image" id="cookies-cream-cupcakes">""</div>
125 | | <div class="prices-table">
... |
134 | | <br/>"Trial flavours available upon request"</div>
135 | | )
| |_____^
|
= help: message: index out of bounds: the len is 0 but the index is 0
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
Maybe the panic could say "all invocations of the html! macro must have exactly 1 root element".
The text was updated successfully, but these errors were encountered:
I'm wondering if I should try and get it to actually accept this and return an iterator of elements - like, there's the <> syntax for this sort of thing in JSX (#18) but that's strictly just to tell the JS parser that a JSX block is starting, but the macro invocation serves that purpose here.
If you do
you get
Maybe the panic could say "all invocations of the html! macro must have exactly 1 root element".
The text was updated successfully, but these errors were encountered: