Skip to content

Commit

Permalink
fix: return from rather than redirectedFrom from useContext
Browse files Browse the repository at this point in the history
closes #444
  • Loading branch information
danielroe committed Apr 8, 2021
1 parent 3f4f3d0 commit a159d87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/composables/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface UseContextReturn
extends Omit<Context, 'route' | 'query' | 'from' | 'params'> {
route: Ref<Route>
query: Ref<Route['query']>
from: Ref<Route['redirectedFrom']>
from: Ref<Context['from']>
params: Ref<Route['params']>
}

Expand Down Expand Up @@ -61,7 +61,7 @@ export const useContext = (): UseContextReturn => {
/**
* @deprecated To smooth your upgrade to Nuxt 3, it is recommended not to access `from` from `useContext` but rather to use the `useRoute` helper function.
*/
from: computed(() => vm.$route.redirectedFrom),
from: computed(() => (vm[globalNuxt] || vm.$options).context.from),
/**
* @deprecated To smooth your upgrade to Nuxt 3, it is recommended not to access `params` from `useContext` but rather to use the `useRoute` helper function.
*/
Expand Down

0 comments on commit a159d87

Please sign in to comment.