
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a React/Next.js nested anchor tag issue, not specifically a Sanity problem, but I can help you solve it!
The warning is happening because you have nested <a> tags - your Link component wraps everything, and then inside it you have another <a> tag in your <h3>. HTML doesn't allow <a> tags to be nested inside other <a> tags.
<a> tagsFor HeroPost component:
export default function HeroPost({
coverImage,
slug,
displayExcerpt,
displayTitle,
}) {
return (
<div className="front-container" data-row-id='1'>
<div className="row-grid-container">
<Link href={`/posts/${slug}`}>
<CoverImage slug={slug} imageObject={coverImage} title={displayTitle} url={coverImage}/>
<div className="title-container">
<p className="excerpt">{displayExcerpt}</p>
<h3 className="title">
{displayTitle} {/* Remove the <a> tag here */}
</h3>
</div>
</Link>
</div>
<SectionSeparator/>
</div>
);
}For PostPreview component:
export default function PostPreview({
title,
coverImage,
slug,
displayTitle,
displayExcerpt,
}) {
return (
<article>
<Link href={`/posts/${slug}`}>
<div className="image-container">
<CoverImage slug={slug} title={title} imageObject={coverImage}
url={imageBuilder(coverImage).url()}/>
</div>
<p className="excerpt">{displayExcerpt}</p>
<h3 className="title hover:underline">
{displayTitle} {/* Remove the <a> tag here */}
</h3>
</Link>
</article>
);
}Link component already renders as an <a> tag that wraps all the content<a> tags at allhover:underline) directly to the <h3> or to the Link component itselfThe entire card/article will now be clickable without any nesting warnings. This is the standard pattern for making card-style components fully clickable in React/Next.js applications.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store