From 4028d0cae3505f5357e33309e7cf2bf8f992b570 Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Mon, 1 Jan 2024 11:28:23 +0100 Subject: [PATCH] docs: warn about hydration issue with URL fragment (#24961) --- docs/3.api/2.composables/use-route.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/3.api/2.composables/use-route.md b/docs/3.api/2.composables/use-route.md index 2b315a4c70..0e28000736 100644 --- a/docs/3.api/2.composables/use-route.md +++ b/docs/3.api/2.composables/use-route.md @@ -44,4 +44,8 @@ Apart from dynamic parameters and query parameters, `useRoute()` also provides t - `path`: encoded pathname section of the URL - `redirectedFrom`: route location that was attempted to access before ending up on the current route location +::callout +Browsers don't send [URL fragments](https://url.spec.whatwg.org/#concept-url-fragment) (for example `#foo`) when making requests. So using `route.fullPath` in your template can trigger hydration issues because this will include the fragment on client but not the server. +:: + :read-more{icon="i-simple-icons-vuedotjs" to="https://router.vuejs.org/api/interfaces/RouteLocationNormalizedLoaded.html"}