Skip to content

Commit

Permalink
unblock code generation for next and html when props are of type boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
vladgrecu committed Dec 16, 2024
1 parent 31ed850 commit 62a8e45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ export const setPropValueForCompStyle = (params: {
if (templateStyle === 'jsx' && isJSXElement(root)) {
root.openingElement?.attributes.forEach((attribute: types.JSXAttribute) => {
if (
attribute.value.type === 'StringLiteral' &&
attribute.value?.type === 'StringLiteral' &&
attribute.value?.value &&
attribute.name.name === attr
attribute.name?.name === attr
) {
attribute.value.value = getClassName(attribute.value.value)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,9 @@ const getValueFromReference = (
}

if (
['string', 'number', 'object', 'element', 'array'].includes(usedReferenceValue?.type) === false
['string', 'number', 'object', 'element', 'array', 'boolean'].includes(
usedReferenceValue?.type
) === false
) {
throw new HTMLComponentGeneratorError(
`Attribute is using dynamic value, but received of type ${JSON.stringify(
Expand Down

0 comments on commit 62a8e45

Please sign in to comment.