Skip to content

Commit

Permalink
Merge pull request #103 from break-stuff/react-bool-props
Browse files Browse the repository at this point in the history
patch react boolean attributes
  • Loading branch information
break-stuff authored Mar 10, 2024
2 parents 6147db5 + 625c021 commit bc40fe4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demo/react-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function App() {
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
<RadioGroup variants="primary" complex="multi" external2="value5" external="value1">
<RadioGroup variants="primary" complex="multi" external2="value5" external="value1" disabled={false}>
<RadioButton value=""></RadioButton>
<RadioButton></RadioButton>
<RadioButton></RadioButton>
Expand Down
4 changes: 4 additions & 0 deletions packages/react-wrappers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.4.2

- Fix boolean properties when setting them to `false`

## 1.4.1

- Allow any string for `descriptionSrc`
Expand Down
2 changes: 1 addition & 1 deletion packages/react-wrappers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-element-react-wrappers",
"version": "1.4.1",
"version": "1.4.2",
"description": "A tool for generating react-compatible wrappers for custom elements",
"main": "index.js",
"module": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-wrappers/src/wrapper-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ function getEventTemplates(eventNames: EventName[]) {
function getBooleanAttributeTemplates(booleanAttributes: MappedAttribute[]) {
return (
booleanAttributes?.map(
(attr) => `'${attr.name}': props.${attr?.propName}`
(attr) => `'${attr.name}': props.${attr?.propName} ? '' : undefined`
) || []
);
}
Expand Down

0 comments on commit bc40fe4

Please sign in to comment.