- Create code-first route tree in src/app/routing/routeTree.tsx - Replace ProtectedRoute with beforeLoad auth guards - Add useSearchParamsCompat for URLSearchParams access - Update App.tsx, layouts, and all page/widget imports - Add frontend tooling: biome, prettier, env config - Update all tests for TanStack Router compatibility - Remove react-router-dom dependency, @tanstack/router-plugin - Consolidate biome config at root level
11 lines
310 B
TypeScript
11 lines
310 B
TypeScript
import { useContext } from 'react'
|
|
import { SessionContext, type SessionContextValue } from './sessionContext'
|
|
|
|
export function useSession(): SessionContextValue {
|
|
const ctx = useContext(SessionContext)
|
|
if (!ctx) {
|
|
throw new Error('useSession must be used within a SessionProvider')
|
|
}
|
|
return ctx
|
|
}
|