Skip to content

Commit

Permalink
docs: error in view! macro if you use cx, (#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj authored Sep 22, 2023
1 parent 38d1727 commit d99269a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions leptos_macro/src/view/client_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ pub(crate) fn node_to_tokens(
Node::Block(node) => Some(quote! { #node }),
Node::RawText(r) => {
let text = r.to_string_best();
if text == "cx," {
proc_macro_error::abort!(
r.span(),
"`cx,` is not used with the `view!` macro in 0.5."
)
}
let text = syn::LitStr::new(&text, r.span());
Some(quote! { #text })
}
Expand Down

0 comments on commit d99269a

Please sign in to comment.