diff --git a/src/transpiling/jsx_precompile.rs b/src/transpiling/jsx_precompile.rs index 1a98f2f..d4c1129 100644 --- a/src/transpiling/jsx_precompile.rs +++ b/src/transpiling/jsx_precompile.rs @@ -16,6 +16,9 @@ pub struct JsxPrecompile { import_source: String, // List of HTML elements which should not be serialized skip_serialize: Option>, + // List of props/attributes that should not be serialized and + // always be treated as dynamic instead. + skip_prop_serialize: Option>, // Internal state next_index: usize, @@ -41,6 +44,7 @@ impl Default for JsxPrecompile { templates: vec![], import_source: "react".to_string(), skip_serialize: None, + skip_prop_serialize: None, import_jsx: None, import_jsx_ssr: None, import_jsx_attr: None, @@ -53,10 +57,12 @@ impl JsxPrecompile { pub fn new( import_source: String, skip_serialize: Option>, + skip_prop_serialize: Option>, ) -> Self { Self { import_source, skip_serialize, + skip_prop_serialize, ..JsxPrecompile::default() } } @@ -250,11 +256,11 @@ fn null_arg() -> ExprOrSpread { } } -fn get_attr_name(jsx_attr: &JSXAttr, is_component: bool) -> String { +fn get_attr_name(jsx_attr: &JSXAttr, normalize: bool) -> String { match &jsx_attr.name { // Case: