-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle styled-jsx in newLinkBehavior codemod (#36628)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9e53af8
commit 20e5fed
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
packages/next-codemod/transforms/__testfixtures__/new-link/styled-jsx.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Link from 'next/link'; | ||
|
||
const CustomLink = ({ | ||
href, | ||
title, | ||
children, | ||
}) => { | ||
return ( | ||
<span className="link-container"> | ||
<Link href={href}> | ||
<a className="link" title={title}> | ||
{children} | ||
</a> | ||
</Link> | ||
<style jsx>{` | ||
.link { | ||
text-decoration: none; | ||
color: var(--geist-foreground); | ||
font-weight: 500; | ||
} | ||
`}</style> | ||
</span> | ||
); | ||
}; | ||
|
||
export default CustomLink; |
26 changes: 26 additions & 0 deletions
26
packages/next-codemod/transforms/__testfixtures__/new-link/styled-jsx.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Link from 'next/link'; | ||
|
||
const CustomLink = ({ | ||
href, | ||
title, | ||
children, | ||
}) => { | ||
return ( | ||
<span className="link-container"> | ||
<Link href={href} legacyBehavior> | ||
<a className="link" title={title}> | ||
{children} | ||
</a> | ||
</Link> | ||
<style jsx>{` | ||
.link { | ||
text-decoration: none; | ||
color: var(--geist-foreground); | ||
font-weight: 500; | ||
} | ||
`}</style> | ||
</span> | ||
); | ||
}; | ||
|
||
export default CustomLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters