Next.js Discord

Discord Forum

Error: link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML

Answered
Silver Fox posted this in #help-forum
Open in Discord
Silver FoxOP
Error: link is a self-closing tag and must neither have children nor use `dangerouslySetInnerHTML
Answered by B33fb0n3
try to look throught your code:
1. what did you changed last?
2. Where did you worked with Link comonents?
3. Where did you closed your link without children like: <Link />?
4. Go through your code and look at all your link components if you dont know where the error comes from
View full answer

7 Replies

Silver FoxOP
no idea where its coming from
@Silver Fox Error: link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML
try to look throught your code:
1. what did you changed last?
2. Where did you worked with Link comonents?
3. Where did you closed your link without children like: <Link />?
4. Go through your code and look at all your link components if you dont know where the error comes from
Answer
@Silver Fox now its giving me Error: Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.
great. Now do the steps again and check where you got an a tag inside a Link tag
@Silver Fox solved?
Silver FoxOP
yea
happy to help