useRoute() does not return reactive object
See original GitHub issueI have something related, when I use the route.name in a computed variable OR use the route(.name) in a watch function it doesn’t get triggered after navigating.
When I output the $route.name in the template tag, this does get updated after navigating.
Some additional info, when I do the following:
In RC.6
console.log(useRoute());
Output:
Proxy with computed values
In edge
console.log(useRoute());
Output:
Regular json object with values
_Originally posted by @rvmourik in https://github.com/nuxt/framework/issues/6273#issuecomment-1203814035_
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Reactive Vue Router object by wrapping in ref() not working
My attempt currently imports the router directly and wraps the currentRoute object in a ref() but that doesn't seem to work. Here is...
Read more >Vue Router and the Composition API
The route object is a reactive object, so any of its properties can be watched and you ... so there is no need...
Read more >useRoute - Nuxt Composition API
When migrating to Nuxt 3 you will need to remove .value as the native equivalent returns a reactive object, not a computed object....
Read more >Reactive Vue Routes With the Composition API
toRefs is useful when returning a reactive object from a composition function to destructure the returned object without losing reactivity.
Read more >[NUXT3] Is there a more elegant way to get current route?
The beauty of reactivity is that you don't have to wrap literally ... The route object returned by useRoute is a fully reactive...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah I see the Pr of @pi0 regardinf esmresolve. I will upgrade tonight and let you know
@rvmourik Try with
yarn upgrade
to ensure that new dependencies are included.