Skip to content

Commit

Permalink
(fix): Append comp-name only for the attributes of type comp-style
Browse files Browse the repository at this point in the history
  • Loading branch information
JayaKrishnaNamburu committed Sep 3, 2024
1 parent cc565bf commit 2b7486a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ export const setPropValueForCompStyle = (params: {

if (templateStyle === 'jsx' && isJSXElement(compInstanceNode)) {
compInstanceNode.openingElement?.attributes.forEach((attribute: types.JSXAttribute) => {
if (attribute.value.type === 'StringLiteral' && attribute.value?.value) {
if (
attribute.value.type === 'StringLiteral' &&
attribute.value?.value &&
attribute.name.name === attr
) {
attribute.value.value = getClassName(attribute.value.value)
}
})
Expand Down

0 comments on commit 2b7486a

Please sign in to comment.