Type augmentation on Inertia types #2248
Unanswered
rrmesquita
asked this question in
Help (React)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I want to augment Inertia types in order to achieve two things:
PageProps
from the inertia package whenever I need to access all shared propsusePage<CurrentPageProps>
. right now, instead of merging, this code would makeCurrentPageProps
override the genericTPageProps
inusePage
, making global props not availableTo do so, I've tried the following:
It's working decently, but with some caveats, like for example, my vscode can no longer auto-import the
usePage
hook, instead I need to manually go up in the file and do it myself. I've tried fixing it by my own but I can't get it to work.With that said, I'm posting this to get to know from you guys, how would go about achieving those needs? Augment (and if so, how would you do it) or use custom defined types everywhere?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions