From d99269afac7acc3f5a1ed0b2b6dfbea6890f8b44 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Fri, 22 Sep 2023 17:29:55 -0400 Subject: [PATCH] docs: error in `view!` macro if you use `cx,` (#1772) --- leptos_macro/src/view/client_builder.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/leptos_macro/src/view/client_builder.rs b/leptos_macro/src/view/client_builder.rs index 6cd21bd521..b4fa314579 100644 --- a/leptos_macro/src/view/client_builder.rs +++ b/leptos_macro/src/view/client_builder.rs @@ -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 }) }