Skip to content

Commit

Permalink
found some missing passHrefs to a tags, reduce some warnings at DOM l…
Browse files Browse the repository at this point in the history
…evels (#859)

* found some missing passHrefs to a tags,  reduce some warnings

* add changeset

Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
  • Loading branch information
Shubham567 and dimaMachina committed Oct 4, 2022
1 parent c09f450 commit b7f7cf6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-elephants-sit.md
@@ -0,0 +1,5 @@
---
'nextra-theme-blog': patch
---

add missing `passHref` for `NextLink`
4 changes: 2 additions & 2 deletions docs/components/card/index.tsx
Expand Up @@ -17,7 +17,7 @@ export function Card({ children, title, icon, image, arrow, href, ...props }) {

if (image) {
return (
<Link href={href}>
<Link href={href} passHref>
<a
className={cn(
styles.card,
Expand All @@ -44,7 +44,7 @@ export function Card({ children, title, icon, image, arrow, href, ...props }) {
}

return (
<Link href={href}>
<Link href={href} passHref>
<a
className={cn(
styles.card,
Expand Down
2 changes: 1 addition & 1 deletion packages/nextra-theme-blog/src/mdx-theme.tsx
Expand Up @@ -52,7 +52,7 @@ const A = ({ children, ...props }: ComponentProps<'a'>) => {
)
}
return props.href ? (
<Link href={props.href}>
<Link href={props.href} passHref>
<a {...props}>{children}</a>
</Link>
) : (
Expand Down
2 changes: 1 addition & 1 deletion packages/nextra-theme-blog/src/meta.tsx
Expand Up @@ -12,7 +12,7 @@ export default function Meta(): ReactElement {
const tags = tag ? split(tag) : []

const tagsEl = tags.map(t => (
<Link key={t} href="/tags/[tag]" as={`/tags/${t}`}>
<Link key={t} href="/tags/[tag]" as={`/tags/${t}`} passHref>
<a
className="
select-none
Expand Down

0 comments on commit b7f7cf6

Please sign in to comment.