Skip to content

Improve type checking of request data#2304

Merged
joetannenbaum merged 1 commit into
masterfrom
request-type-checking
Apr 10, 2025
Merged

Improve type checking of request data#2304
joetannenbaum merged 1 commit into
masterfrom
request-type-checking

Conversation

@joetannenbaum

Copy link
Copy Markdown
Contributor

All credit to @7nohe from #1537

import { router } from '@inertiajs/vue3'

type RequestData = { message: string }

router.post<RequestData>(url, { title: 'hello' }, options) // <- TypeScript Error
router.post<RequestData>(url, { message: 'hello' }, options) // <- OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant