Skip to content

Commit

Permalink
Fix hot reload custom element (#2866)
Browse files Browse the repository at this point in the history
* Fix hot reloading attributes on web components
  • Loading branch information
ealmloff authored Aug 20, 2024
1 parent 3c699aa commit 6a46a66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/rsx/src/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ impl Attribute {
let element_name = self.el_name.as_ref().unwrap();
let rust_name = match element_name {
ElementName::Ident(i) => i.to_string(),
ElementName::Custom(s) => return (intern(s.value()), None),
// If this is a web component, just use the name of the elements instead of mapping the attribute
// through the hot reloading context
ElementName::Custom(_) => return (intern(attribute_name_rust.as_str()), None),
};

Ctx::map_attribute(&rust_name, &attribute_name_rust)
Expand Down

0 comments on commit 6a46a66

Please sign in to comment.