Unverified Commit 16a5aa74 authored by Li Ming's avatar Li Ming Committed by GitHub

feature: Update cases in [Incorrect nesting of HTML tags] (#53282)

It took me much time to debug this issue during my development process, and since the error logs(you can see below) given are not very clear, I hope it will help others who encounter the same problem.

<img width="954" alt="image" src="https://github.com/vercel/next.js/assets/1228449/69fd949e-f396-44e3-833c-8e7bbf080492">

ref: 
- [Are you allowed to nest a link inside of a link?](https://stackoverflow.com/questions/9882916/are-you-allowed-to-nest-a-link-inside-of-a-link)
- [Interactive Content](https://html.spec.whatwg.org/#interactive-content-2)
<img width="1283" alt="image" src="https://github.com/vercel/next.js/assets/1228449/db864080-14fd-45e1-9468-54365c6afddc">
Co-authored-by: 's avatarSteven <229881+styfle@users.noreply.github.com>
parent 127e30ed
...@@ -15,6 +15,7 @@ Hydration errors can occur from: ...@@ -15,6 +15,7 @@ Hydration errors can occur from:
1. Incorrect nesting of HTML tags 1. Incorrect nesting of HTML tags
1. `<p>` nested in another `<p>` tag 1. `<p>` nested in another `<p>` tag
2. `<div>` nested in a `<p>` tag 2. `<div>` nested in a `<p>` tag
3. [Interactive Content](https://html.spec.whatwg.org/#interactive-content-2) cannot be nested (`<a>` nested in a `<a>` tag, `<button>` nested in a `<button>` tag, etc)
2. Using checks like `typeof window !== 'undefined'` in your rendering logic 2. Using checks like `typeof window !== 'undefined'` in your rendering logic
3. Using browser-only APIs like `window` or `localStorage` in your rendering logic 3. Using browser-only APIs like `window` or `localStorage` in your rendering logic
4. [Browser extensions](https://github.com/facebook/react/issues/24430) modifying the HTML 4. [Browser extensions](https://github.com/facebook/react/issues/24430) modifying the HTML
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment