Skip to content

Commit

Permalink
fix nested jsx elements, update version
Browse files Browse the repository at this point in the history
  • Loading branch information
benStre committed Sep 4, 2024
1 parent 27c0052 commit a392178
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jusix"
version = "0.1.6"
version = "0.1.8"
edition = "2021"
description = "An SWC plugin that enables embedded JSX reactivity and $() shortcut function for UIX"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jusix",
"version": "0.1.6",
"version": "0.1.8",
"description": "",
"author": "",
"license": "ISC",
Expand Down
6 changes: 3 additions & 3 deletions src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,18 +469,18 @@ impl Fold for TransformVisitor {
JSXElementChild::JSXElement(e) => JSXElementChild::JSXElement(
Box::new(JSXElement {
span: DUMMY_SP,
opening: e.opening,
opening: e.opening.fold_with(self),
children: self.fold_jsx_element_childs(e.children),
closing: e.closing,
})
),
_ => child,
_ => child
}
}

fn fold_jsx_element_childs(&mut self, node: Vec<JSXElementChild>) -> Vec<JSXElementChild> {
node.into_iter()
.map(|child| self.fold_jsx_element_child(child))
.map(|child| child.fold_with(self))
.collect()
}

Expand Down

0 comments on commit a392178

Please sign in to comment.