Skip to content

Commit 7ad821b

Browse files
bcostaaa01posva
authored andcommitted
docs: fix the name of the store initialization (#2897)
1 parent 85dd65c commit 7ad821b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/docs/core-concepts/outside-component-usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const router = createRouter({
4242
})
4343

4444
// ❌ Depending on the order of imports this will fail
45-
const store = useStore()
45+
const store = useUserStore()
4646

4747
router.beforeEach((to, from, next) => {
4848
// we wanted to use the store here
@@ -53,7 +53,7 @@ router.beforeEach((to, from, next) => {
5353
router.beforeEach((to) => {
5454
// ✅ This will work because the router starts its navigation after
5555
// the router is installed and pinia will be installed too
56-
const store = useStore()
56+
const store = useUserStore()
5757

5858
if (to.meta.requiresAuth && !store.isLoggedIn) return '/login'
5959
})

0 commit comments

Comments
 (0)