#usePage and Typescript types

1 messages · Page 1 of 1 (latest)

round dune
#

I am trying to use breeze template with typescript but usePage have no types by default? Do i need to import types separately? This works, but i get TS errors ```<script setup lang="ts">
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
import { Head, usePage } from '@inertiajs/vue3';

const page = usePage();

const name = page.props.auth.user.name;

</script>```

tulip totem
#

AFAIK usePage has a generic, so you'd pass that along to it, Inertia doesn't generate types for the props you return server-side