Typescript InertiaConfig sharedPageProps not merging in usePage return type
#2848
Unanswered
UltraWelfare
asked this question in
Help (React)
Replies: 1 comment
-
|
Seems like an IDE issue. After writing the shared prop it correctly finds out the type... There has to be a problem on the auto completion part of the IDE (PhpStorm - WebStorm). I'll leave the discussion open just in case someone else happens to fall on the same issue I've opened a relevant issue in their tracker: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From the docs:
I pasted the example to
/types/global.d.tsand usePage typing breaks completely. I figured out that it's missingimport '@inertiajs/core'in order for TS to acknowledge it as a module. Once I added that import, the usePage type is back but it doesn't seem to merge thesharedPagePropsMy modified
global.d.ts:The flash is correctly inferred (which also means that the module augmentation is working correctly):

However the props do not contain the
nameandauthshared props:I tried to follow the source code of the types and I don't see any clear indication of what's happening.. Could it be an IDE issue?
I'm using the latest PhpStorm 2025.3.2
Beta Was this translation helpful? Give feedback.
All reactions