handle expressions in attributes

This commit is contained in:
Evan Almloff committed 2022-05-26 19:16:51 -05:00
1 parent 62cca95905
commit 5b0a60c294
4 files changed
+85 -51

No files matched your search

+3 -2
View File
@@ -194,6 +194,8 @@ pub fn rsx(s: TokenStream) -> TokenStream {
{
let line_num = get_line_num();
let rsx_text_index: RsxTextIndex = cx.consume_context().unwrap();
// only the insert the rsx text once
// todo: rsx could be conditionally rendered which would brake this
use_state(&cx, || {
rsx_text_index.insert(
line_num.clone(),
@@ -210,8 +212,7 @@ pub fn rsx(s: TokenStream) -> TokenStream {
)
}
else{
println!("rsx: line number {:?} not found", line_num);
factory.static_text("")
panic!("rsx: line number {:?} not found", line_num);
}
})
}