Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArticleItem requires legacyBehavior prop with <a> children #7

Open
desrtCodr opened this issue Nov 7, 2022 · 2 comments
Open

ArticleItem requires legacyBehavior prop with <a> children #7

desrtCodr opened this issue Nov 7, 2022 · 2 comments

Comments

@desrtCodr
Copy link

I believe the ArticleItem.js component needs to be updated to include the "legacyBehavior" prop due to the fact that <a> tags are used as children. Or needs to be refactored to meet the new Link requirements.

possible solution:

import Link from 'next/link'
import articleStyles from '../styles/Article.module.css'

const ArticleItem = ({ article }) => {
  return (
    <Link legacyBehavior href={`/article/${article.id}`}>
      <a className={articleStyles.card}>
        <h3>{article.title} &rarr;</h3>
        <p>{article.body}</p>
      </a>
    </Link>
  )
}

export default ArticleItem
@RamiZuhairi
Copy link

RamiZuhairi commented Jan 17, 2023

great one thank you , I have solved that by putting div tag instead of a tag

@Hitendra27
Copy link

Thank you guys. solved it too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants