From a8de778c58f9de8dec77c52135a4128c4b7b0d86 Mon Sep 17 00:00:00 2001 From: Pascal Baljet Date: Thu, 16 Oct 2025 12:05:04 +0200 Subject: [PATCH 1/2] Add `globals.d.ts` file to Playgrounds --- playgrounds/react/resources/js/types/globals.d.ts | 9 +++++++++ playgrounds/svelte4/resources/js/types/globals.d.ts | 9 +++++++++ playgrounds/svelte5/resources/js/types/globals.d.ts | 9 +++++++++ playgrounds/vue3/resources/js/types/globals.d.ts | 9 +++++++++ playgrounds/vue3/tsconfig.json | 2 +- 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 playgrounds/react/resources/js/types/globals.d.ts create mode 100644 playgrounds/svelte4/resources/js/types/globals.d.ts create mode 100644 playgrounds/svelte5/resources/js/types/globals.d.ts create mode 100644 playgrounds/vue3/resources/js/types/globals.d.ts diff --git a/playgrounds/react/resources/js/types/globals.d.ts b/playgrounds/react/resources/js/types/globals.d.ts new file mode 100644 index 000000000..6fbfc877d --- /dev/null +++ b/playgrounds/react/resources/js/types/globals.d.ts @@ -0,0 +1,9 @@ +import '@inertiajs/core' + +declare module '@inertiajs/core' { + export interface InertiaConfig { + sharedPageProps: { + appName: string + } + } +} diff --git a/playgrounds/svelte4/resources/js/types/globals.d.ts b/playgrounds/svelte4/resources/js/types/globals.d.ts new file mode 100644 index 000000000..6fbfc877d --- /dev/null +++ b/playgrounds/svelte4/resources/js/types/globals.d.ts @@ -0,0 +1,9 @@ +import '@inertiajs/core' + +declare module '@inertiajs/core' { + export interface InertiaConfig { + sharedPageProps: { + appName: string + } + } +} diff --git a/playgrounds/svelte5/resources/js/types/globals.d.ts b/playgrounds/svelte5/resources/js/types/globals.d.ts new file mode 100644 index 000000000..6fbfc877d --- /dev/null +++ b/playgrounds/svelte5/resources/js/types/globals.d.ts @@ -0,0 +1,9 @@ +import '@inertiajs/core' + +declare module '@inertiajs/core' { + export interface InertiaConfig { + sharedPageProps: { + appName: string + } + } +} diff --git a/playgrounds/vue3/resources/js/types/globals.d.ts b/playgrounds/vue3/resources/js/types/globals.d.ts new file mode 100644 index 000000000..6fbfc877d --- /dev/null +++ b/playgrounds/vue3/resources/js/types/globals.d.ts @@ -0,0 +1,9 @@ +import '@inertiajs/core' + +declare module '@inertiajs/core' { + export interface InertiaConfig { + sharedPageProps: { + appName: string + } + } +} diff --git a/playgrounds/vue3/tsconfig.json b/playgrounds/vue3/tsconfig.json index 44588fb93..c230de857 100644 --- a/playgrounds/vue3/tsconfig.json +++ b/playgrounds/vue3/tsconfig.json @@ -11,5 +11,5 @@ "noEmit": true, "skipLibCheck": true }, - "include": ["resources/js/**/*.ts", "resources/js/**/*.d.ts", "src/**/*.vue"] + "include": ["resources/js/**/*.ts", "resources/js/**/*.d.ts", "resources/js/**/*.vue"] } From 549d1b3b874e35f63c163147cd249d0b34032c74 Mon Sep 17 00:00:00 2001 From: Pascal Baljet Date: Thu, 16 Oct 2025 12:06:00 +0200 Subject: [PATCH 2/2] Update Layout.tsx --- playgrounds/react/resources/js/Components/Layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playgrounds/react/resources/js/Components/Layout.tsx b/playgrounds/react/resources/js/Components/Layout.tsx index 69d7cb70b..ab6363618 100644 --- a/playgrounds/react/resources/js/Components/Layout.tsx +++ b/playgrounds/react/resources/js/Components/Layout.tsx @@ -1,7 +1,7 @@ import { Link, usePage } from '@inertiajs/react' export default function Layout({ children, padding = true }: { children: React.ReactNode; padding?: boolean }) { - const { appName } = usePage<{ appName: string }>().props + const { appName } = usePage().props return ( <>