You don’t need to prop-drill or use provide/inject for usePage() data.
In Inertia, the recommended approach is to access shared props directly via usePage() wherever they’re needed. It’s already reactive and available to all components, so prop drilling just adds unnecessary complexity.
A clean pattern is to wrap it in a small composable:
Copy code
Js
import { computed } from 'vue'
import { usePage } from '@inertiajs/vue3'
export function useAuth() {
const page = usePage()
const auth = computed(() => page.props.auth ?? 'Guest')
return { auth }
}
Then you can use it in any component:
Copy code
Js
import { useAuth } from '@/composables/useAuth'
const { auth } = useAuth()
This keeps things simple, avoids repetition, and follows Inertia’s intended design.