Unverified Commit 5451564f authored by Josh Parnham's avatar Josh Parnham Committed by GitHub

[docs] Add iOS hydration mismatch details to error page (#43584)

We recently ran into hydration mismatch errors on iOS, which we realised
was due to iOS automatically converting what it thought were phone
numbers into links.

We then found this GitHub issue,
https://github.com/vercel/next.js/issues/38290, and thought it would be
useful to add these details to the documentation page linked from the
next.js error.

---

Example from the linked issue:


![image](https://user-images.githubusercontent.com/712727/204925813-f986e2ca-29c2-4b63-9121-df4c7b00b1d8.png)

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
Co-authored-by: 's avatarTim Neutkens <tim@timneutkens.nl>
parent 81f5ed7a
...@@ -82,10 +82,18 @@ Common causes with css-in-js libraries: ...@@ -82,10 +82,18 @@ Common causes with css-in-js libraries:
- When using other css-in-js libraries - When using other css-in-js libraries
- Similar to Styled Components / Emotion css-in-js libraries generally need configuration specified in their examples in the [examples directory](https://github.com/vercel/next.js/tree/canary/examples) - Similar to Styled Components / Emotion css-in-js libraries generally need configuration specified in their examples in the [examples directory](https://github.com/vercel/next.js/tree/canary/examples)
Local Overrides Local Overrides:
It's possible you may have [Local Overrides enabled in Chrome devtools](https://developer.chrome.com/blog/new-in-devtools-65/#overrides). With this enabled, the HTML served will be different from what the SSR emitted. It also won't show up in view-source, so you may be left wondering what is going on. It's possible you may have [Local Overrides enabled in Chrome devtools](https://developer.chrome.com/blog/new-in-devtools-65/#overrides). With this enabled, the HTML served will be different from what the SSR emitted. It also won't show up in view-source, so you may be left wondering what is going on.
Common causes on iOS:
- iOS attempts to detect phone numbers, email addressees and other data in text content and convert them into links, which can [lead to hydration mismatches](https://github.com/vercel/next.js/issues/38290). This can be disabled with the following `meta` tag:
```
<meta name="format-detection" content="telephone=no, date=no, email=no, address=no" />
```
### Useful Links ### Useful Links
- [React Hydration Documentation](https://react.dev/reference/react-dom/client/hydrateRoot) - [React Hydration Documentation](https://react.dev/reference/react-dom/client/hydrateRoot)
......
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