Skip to content

Commit

Permalink
Bugfix: handle undefined <style> tag attr.name
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasMatuszewski committed Feb 29, 2024
1 parent 7e7743a commit 812b6e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const isGlobalEl = el =>
export const isStyledJsx = ({ node: el }) =>
t.isJSXElement(el) &&
el.openingElement.name.name === 'style' &&
el.openingElement.attributes.some(attr => attr.name.name === STYLE_ATTRIBUTE)
el.openingElement.attributes.some(({ name }) => name && name.name === STYLE_ATTRIBUTE)

export const findStyles = path => {
if (isStyledJsx(path)) {
Expand Down

0 comments on commit 812b6e7

Please sign in to comment.