question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useRoute() does not return reactive object

See original GitHub issue

I 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rvmourikcommented, Aug 4, 2022

Ah I see the Pr of @pi0 regardinf esmresolve. I will upgrade tonight and let you know

1reaction
danielroecommented, Aug 4, 2022

@rvmourik Try with yarn upgrade to ensure that new dependencies are included.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found