Skip to content

Commit

Permalink
refactor: improve JSX parser to support boolean props
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jan 17, 2023
1 parent 4687b6a commit 7c79cdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ class Parser {

const attr = ensureArray(node.openingElement.attributes)
.reduce((acc, attribute) => {
if (attribute.type !== 'JSXAttribute' || attribute.name.type !== 'JSXIdentifier') {
if (attribute.type !== 'JSXAttribute' || attribute.name.type !== 'JSXIdentifier' || attribute.value === null) {
return acc;
}

Expand Down

0 comments on commit 7c79cdc

Please sign in to comment.