I want to put router lazy, but if a put the context it's not gonna work
import { createLazyFileRoute, redirect } from '@tanstack/react-router'
import Home from "@pages/home"
export const Route = createLazyFileRoute('/')({
beforeLoad: ({ context, location }) => {
if (!context.auth.isAuthenticated) {
console.log("context auth: ",context.auth.isAuthenticated)
throw redirect({
to: '/login',
search: {
redirect: location.href,
},
})
}
},
component: Home
})