Skip to content

Commit

Permalink
fix: add test for jsx member component
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister committed Oct 21, 2023
1 parent 016df3b commit f9c4785
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/transpiling/jsx_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,18 @@ const a = _jsx(Foo, {
);
}

#[test]
fn component_with_jsx_member_test() {
test_transform(
JsxString::default(),
r#"const a = <ctx.Provider value={null} />;"#,
r#"import { jsx as _jsx } from "react/jsx-runtime";
const a = _jsx(ctx.Provider, {
"value": null
});"#,
);
}

// TODO: What to do with keys?
// TODO: Should we go with function calls for dynamic attributes instead
// of an object for DOM nodes? Would allow us to skip an allocation.
Expand Down

0 comments on commit f9c4785

Please sign in to comment.